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