Updates HA when changes happen from WebSockets or MQTT
Websockets and MQTT components are separate from HA MQTT JSON. Now if either is changed, HA JSON MQTT component is updated.
This commit is contained in:
parent
10f89a7e39
commit
69a22006c8
1 changed files with 6 additions and 0 deletions
|
@ -445,6 +445,11 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
||||||
handleAutoStop();
|
handleAutoStop();
|
||||||
webSocket.sendTXT(num, "OK");
|
webSocket.sendTXT(num, "OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_HOMEASSISTANT
|
||||||
|
sendState();
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -725,6 +730,7 @@ void checkForRequests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_HOMEASSISTANT
|
#ifdef ENABLE_HOMEASSISTANT
|
||||||
|
sendState();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
free(payload);
|
free(payload);
|
||||||
|
|
Loading…
Reference in a new issue