4 Commits

Author SHA1 Message Date
90133a7d67 Version 1.42
Fixed some bugs.
2023-03-15 16:37:19 +03:00
dd3cbb9633 Fixed one bug 2023-03-12 12:49:50 +03:00
0b64933ee7 Minor changes 2023-03-07 11:58:03 +03:00
1d8d8e3f7d Fixed one bug 2023-03-06 00:43:29 +03:00
2 changed files with 6 additions and 5 deletions

View File

@ -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<espnow_message_t> espnowMessage;
const String firmware{"1.42"};
bool relayStatus{false};
bool wasMqttAvailable{false};
@ -220,7 +221,7 @@ void onUnicastReceiving(const char *data, const uint8_t *sender)
else
digitalWrite(config.ledPin, config.ledPinType ? relayStatus : !relayStatus);
}
saveConfig();
saveStatus();
sendStatusMessage();
}
if (incomingData.payloadsType == ENPT_UPDATE)
@ -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);