publish reset event
This commit is contained in:
@@ -116,7 +116,7 @@ void MyMqttClient::onLoop()
|
||||
ensureConnected();
|
||||
mqttClient.loop();
|
||||
|
||||
static uint32_t tNextRssiMs = 0;
|
||||
static uint32_t tNextRssiMs = 0u;
|
||||
if (millis() >= tNextRssiMs)
|
||||
{
|
||||
tNextRssiMs = millis() + 600000u;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <Update.h>
|
||||
#include "Version.h"
|
||||
#include "InterruptHandler.h"
|
||||
#include "MyMqttClient.h"
|
||||
|
||||
WebServer webServer;
|
||||
|
||||
@@ -75,6 +76,7 @@ void UpdateHandler()
|
||||
{
|
||||
webServer.sendHeader("Connection", "close");
|
||||
webServer.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
|
||||
myMqttClient.publishStatus("{\"event\":\"reset_update\", \"variant\": \"" PROJECT_VARIANT "\" }");
|
||||
ESP.restart();
|
||||
}, []()
|
||||
{
|
||||
|
||||
@@ -272,6 +272,7 @@ void loop()
|
||||
if (millis() > DAYS_TO_MILLIS(1uL) && numberWindowsOpen == 0)
|
||||
{
|
||||
Serial.print("RESET");
|
||||
myMqttClient.publishStatus("{\"event\":\"reset\", \"variant\": \"" PROJECT_VARIANT "\" }");
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user