mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-23 03:06:42 +00:00
Switch HA message order
This commit is contained in:
parent
0ef0f8c520
commit
c780fabead
@ -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
|
} else if(topic == strstr_P(topic, PSTR("homeassistant/status"))) { // HA discovery topic
|
||||||
if(mqttHAautodiscover && !strcasecmp_P((char*)payload, PSTR("online"))) {
|
if(mqttHAautodiscover && !strcasecmp_P((char*)payload, PSTR("online"))) {
|
||||||
dispatch_current_state();
|
mqtt_ha_register_auto_discovery(); // auto-discovery first
|
||||||
mqtt_ha_register_auto_discovery();
|
dispatch_current_state(); // send the data
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user