diff --git a/src/main.cpp b/src/main.cpp index 4dcb1da..940d287 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,6 @@ typedef struct struct deviceConfig { - const String firmware{"1.41"}; String espnowNetName{"DEFAULT"}; uint8_t workMode{0}; String deviceName = "ESP-NOW switch " + String(ESP.getChipId(), HEX); @@ -53,6 +52,8 @@ struct deviceConfig std::vector espnowMessage; +const String firmware{"1.41"}; + bool relayStatus{false}; bool wasMqttAvailable{false}; @@ -341,7 +342,7 @@ void setupWebServer() { String configJson; DynamicJsonDocument json(384); // To calculate the buffer size uses https://arduinojson.org/v6/assistant. - json["firmware"] = config.firmware; + json["firmware"] = firmware; json["espnowNetName"] = config.espnowNetName; json["deviceName"] = config.deviceName; json["relayPin"] = config.relayPin; @@ -417,7 +418,7 @@ void sendAttributesMessage(const uint8_t type) } json["MCU"] = "ESP8266"; json["MAC"] = myNet.getNodeMac(); - json["Firmware"] = config.firmware; + json["Firmware"] = firmware; json["Library"] = myNet.getFirmwareVersion(); json["Uptime"] = "Days:" + String(days) + " Hours:" + String(hours - (days * 24)) + " Mins:" + String(mins - (hours * 60)); serializeJsonPretty(json, outgoingData.message);