Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions WAdapter/WNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class WNetwork {
this->apStartedAt = 0;
this->lastLoopLog = 0;
#ifndef MINIMAL
this->lastMqttHassAutodiscoverySent = 0;
this->mqttClient = nullptr;
#endif

Expand Down Expand Up @@ -1046,7 +1045,6 @@ void handleHttpFirmwareUpdateFinished(AsyncWebServerRequest *request) {
#ifndef MINIMAL
WAdapterMqtt *mqttClient;
long lastMqttConnect;
unsigned long lastMqttHassAutodiscoverySent;
#endif
WProperty *ssid;
WProperty *idx;
Expand Down Expand Up @@ -1239,9 +1237,9 @@ void handleHttpFirmwareUpdateFinished(AsyncWebServerRequest *request) {
notify(false);

#ifndef MINIMAL
if (lastMqttHassAutodiscoverySent==0){
if (sendMqttHassAutodiscover(false) ) lastMqttHassAutodiscoverySent=millis();
}
// always re-announce HASS autodiscovery on (re)connect so a broker restart
// (which drops retained messages) self-heals without a device reboot
sendMqttHassAutodiscover(false);
#endif
return true;
} else {
Expand Down