From 648a19775e6adddce81354f8cdfd8ec911f799ad Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Mon, 6 Mar 2023 00:44:59 +0300 Subject: [PATCH] Fixed one bug --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e2b6076..f867564 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,6 @@ typedef struct struct deviceConfig { - const String firmware{"1.21"}; String espnowNetName{"DEFAULT"}; String deviceName = "ESP-NOW light " + String(ESP.getChipId(), HEX); uint8_t ledType{ENLT_NONE}; @@ -47,6 +46,8 @@ struct deviceConfig std::vector espnowMessage; +const String firmware{"1.21"}; + bool ledStatus{false}; uint8_t brightness{255}; uint16_t temperature{255}; @@ -311,7 +312,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["ledType"] = config.ledType; @@ -349,7 +350,7 @@ void sendAttributesMessage() json["Type"] = "ESP-NOW light"; 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);