Switch HA message order

This commit is contained in:
fvanroie 2021-03-01 04:29:53 +01:00
parent 0ef0f8c520
commit c780fabead

View File

@ -169,8 +169,8 @@ static void mqtt_message_cb(char* topic, byte* payload, unsigned int length)
} else if(topic == strstr_P(topic, PSTR("homeassistant/status"))) { // HA discovery topic
if(mqttHAautodiscover && !strcasecmp_P((char*)payload, PSTR("online"))) {
dispatch_current_state();
mqtt_ha_register_auto_discovery();
mqtt_ha_register_auto_discovery(); // auto-discovery first
dispatch_current_state(); // send the data
}
return;