feat(webconfig): expose mqtt.neighbors controls in the web portal
- Allow mqtt.neighbors and mqtt.neighbors.interval in the WebConfigKeys set-key allowlist (the CLI enforces the PSRAM guard; the stub reply handles non-PSRAM). - Emit neighbors + neighbors_interval (hours) in the WebConfigServer config JSON. - Add a "Publish neighbors" toggle and a "Neighbors interval (hours)" field (12-336) to the Publishing card, with getVal() cases in webui/index.html. - Cover both keys in test_webconfig_keys. WebConfigHtml.h is a gitignored build artifact regenerated by the pre-build hook from index.html, so it is not committed. Verified: test_webconfig_keys passes and the T_Beam_S3_Supreme observer_mqtt firmware builds [SUCCESS].
This commit is contained in:
1 parent
6911981573
commit
d6f8a87183
4 files changed
+15
-2
No files matched your search
@@ -23,7 +23,8 @@ static const char* const WC_ALLOWED_SET_KEYS[] = {
|
||||
// MQTTPrefs (WiFi / MQTT / misc observer)
|
||||
"wifi.ssid", "wifi.pwd", "wifi.powersave",
|
||||
"mqtt.origin", "mqtt.iata", "mqtt.status", "mqtt.packets", "mqtt.raw",
|
||||
"mqtt.tx", "mqtt.rx", "mqtt.interval", "mqtt.ntp", "mqtt.owner", "mqtt.email",
|
||||
"mqtt.tx", "mqtt.rx", "mqtt.interval", "mqtt.neighbors", "mqtt.neighbors.interval",
|
||||
"mqtt.ntp", "mqtt.owner", "mqtt.email",
|
||||
"timezone", "timezone.offset", "snmp", "snmp.community",
|
||||
};
|
||||
static const char* const WC_ALLOWED_SLOT_KEYS[] = {
|
||||
|
||||
@@ -591,6 +591,8 @@ void WebConfigServer::handleConfigGet(AsyncWebServerRequest* req) {
|
||||
: _obs->mqtt_tx_enabled == 1 ? "on" : "off";
|
||||
mqtt["rx"] = (bool)_obs->mqtt_rx_enabled;
|
||||
mqtt["interval"] = _obs->mqtt_status_interval / 60000; // CLI takes minutes
|
||||
mqtt["neighbors"] = (bool)_obs->mqtt_neighbors_enabled;
|
||||
mqtt["neighbors_interval"] = _obs->mqtt_neighbors_interval / 3600000UL; // CLI takes hours
|
||||
mqtt["timezone"] = (const char*)_obs->timezone_string;
|
||||
mqtt["timezone_offset"] = _obs->timezone_offset;
|
||||
mqtt["ntp"] = (const char*)_obs->mqtt_ntp_server;
|
||||
|
||||
Reference in new issue
Block a user