Browse Source

ha: send discovery on reconnect

master
Maxim Prokhorov 5 years ago
parent
commit
9956cd835b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      code/espurna/homeassistant.ino

+ 1
- 1
code/espurna/homeassistant.ino View File

@ -526,7 +526,7 @@ void haSetup() {
// On MQTT connect check if we have something to send // On MQTT connect check if we have something to send
mqttRegister([](unsigned int type, const char * topic, const char * payload) { mqttRegister([](unsigned int type, const char * topic, const char * payload) {
if (type == MQTT_CONNECT_EVENT) _haSend(); if (type == MQTT_CONNECT_EVENT) _haSend();
if (type == MQTT_DISCONNECT_EVENT) _ha_send_flag = false;
if (type == MQTT_DISCONNECT_EVENT) _ha_send_flag = _ha_enabled;
}); });
// Main callbacks // Main callbacks


Loading…
Cancel
Save