Minor bug fix

pull/41/head
Hieromon Ikasamo 6 years ago
parent 284b19b276
commit 2ac069c42c
  1. 6
      examples/mqttRSSI/mqttRSSI.ino
  2. 2
      examples/mqttRSSI_FS/data/mqtt_setting.json
  3. 2
      examples/mqttRSSI_FS/mqttRSSI_FS.ino

@ -49,7 +49,7 @@ static const char AUX_mqtt_setting[] PROGMEM = R"raw(
"name": "header", "name": "header",
"type": "ACText", "type": "ACText",
"value": "<h2>MQTT broker settings</h2>", "value": "<h2>MQTT broker settings</h2>",
"style": "text-align:center;color:#2f4f4f;padding:10px;" "style": "text-align:center;color:#2f4f4f;"
}, },
{ {
"name": "caption", "name": "caption",
@ -89,7 +89,7 @@ static const char AUX_mqtt_setting[] PROGMEM = R"raw(
"type": "ACCheckbox", "type": "ACCheckbox",
"value": "unique", "value": "unique",
"label": "Use APID unique", "label": "Use APID unique",
"checked": true "checked": false
}, },
{ {
"name": "period", "name": "period",
@ -354,6 +354,8 @@ void setup() {
if (portal.load(FPSTR(AUX_mqtt_setting))) { if (portal.load(FPSTR(AUX_mqtt_setting))) {
AutoConnectAux* setting = portal.aux(AUX_SETTING_URI); AutoConnectAux* setting = portal.aux(AUX_SETTING_URI);
PageArgument args;
loadParams(*setting, args);
AutoConnectCheckbox& uniqueidElm = setting->getElement<AutoConnectCheckbox>("uniqueid"); AutoConnectCheckbox& uniqueidElm = setting->getElement<AutoConnectCheckbox>("uniqueid");
AutoConnectInput& hostnameElm = setting->getElement<AutoConnectInput>("hostname"); AutoConnectInput& hostnameElm = setting->getElement<AutoConnectInput>("hostname");
if (uniqueidElm.checked) { if (uniqueidElm.checked) {

@ -7,7 +7,7 @@
"name": "header", "name": "header",
"type": "ACText", "type": "ACText",
"value": "<h2>MQTT broker settings</h2>", "value": "<h2>MQTT broker settings</h2>",
"style": "text-align:center;color:#2f4f4f;padding:10px;" "style": "text-align:center;color:#2f4f4f;"
}, },
{ {
"name": "caption", "name": "caption",

@ -242,6 +242,8 @@ void setup() {
AutoConnectAux* setting = portal.aux(AUX_MQTTSETTING); AutoConnectAux* setting = portal.aux(AUX_MQTTSETTING);
if (setting) { if (setting) {
PageArgument args;
loadParams(*setting, args);
AutoConnectCheckbox& uniqueidElm = setting->getElement<AutoConnectCheckbox>("uniqueid"); AutoConnectCheckbox& uniqueidElm = setting->getElement<AutoConnectCheckbox>("uniqueid");
AutoConnectInput& hostnameElm = setting->getElement<AutoConnectInput>("hostname"); AutoConnectInput& hostnameElm = setting->getElement<AutoConnectInput>("hostname");
if (uniqueidElm.checked) { if (uniqueidElm.checked) {

Loading…
Cancel
Save