From 9956cd835b4f5561fcb43b1d24e810156f4ea208 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Fri, 1 Nov 2019 23:18:57 +0300 Subject: [PATCH] ha: send discovery on reconnect --- code/espurna/homeassistant.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/espurna/homeassistant.ino b/code/espurna/homeassistant.ino index 436abea2..4155526c 100644 --- a/code/espurna/homeassistant.ino +++ b/code/espurna/homeassistant.ino @@ -526,7 +526,7 @@ void haSetup() { // On MQTT connect check if we have something to send mqttRegister([](unsigned int type, const char * topic, const char * payload) { 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