clear wifi fallback on mqtt reset
This commit is contained in:
@@ -926,3 +926,8 @@ void Network::addReconnectedCallback(std::function<void()> reconnectedCallback)
|
||||
{
|
||||
_reconnectedCallbacks.push_back(reconnectedCallback);
|
||||
}
|
||||
|
||||
void Network::clearWifiFallback()
|
||||
{
|
||||
memset(WiFi_fallbackDetect, 0, sizeof(WiFi_fallbackDetect));
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
void publishHASSBleRssiConfig(char* deviceType, const char* baseTopic, char* name, char* uidString);
|
||||
void removeHASSConfig(char* uidString);
|
||||
|
||||
void clearWifiFallback();
|
||||
|
||||
void publishPresenceDetection(char* csv);
|
||||
|
||||
int mqttConnectionState(); // 0 = not connected; 1 = connected; 2 = connected and mqtt processed
|
||||
|
||||
@@ -93,6 +93,7 @@ void NetworkLock::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
if(comparePrefixedPath(topic, mqtt_topic_reset) && strcmp(value, "1") == 0)
|
||||
{
|
||||
Log->println(F("Restart requested via MQTT."));
|
||||
_network->clearWifiFallback();
|
||||
delay(200);
|
||||
restartEsp(RestartReason::RequestedViaMqtt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user