publishh autodiscovery topics after reconnect
This commit is contained in:
@@ -56,6 +56,11 @@ void NetworkOpener::initialize()
|
||||
_network->initTopic(_mqttPath, mqtt_topic_keypad_command_code, "000000");
|
||||
_network->initTopic(_mqttPath, mqtt_topic_keypad_command_enabled, "1");
|
||||
}
|
||||
|
||||
_network->addReconnectedCallback([&]()
|
||||
{
|
||||
_reconnected = true;
|
||||
});
|
||||
}
|
||||
|
||||
void NetworkOpener::update()
|
||||
@@ -600,3 +605,10 @@ String NetworkOpener::concat(String a, String b)
|
||||
c.concat(b);
|
||||
return c;
|
||||
}
|
||||
|
||||
bool NetworkOpener::reconnected()
|
||||
{
|
||||
bool r = _reconnected;
|
||||
_reconnected = false;
|
||||
return r;
|
||||
}
|
||||
Reference in New Issue
Block a user