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:
Deb 2018-02-28 12:55:29 -05:00 committed by GitHub
parent 10f89a7e39
commit 69a22006c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -445,6 +445,11 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
handleAutoStop();
webSocket.sendTXT(num, "OK");
}
#ifdef ENABLE_HOMEASSISTANT
sendState();
#endif
break;
}
}
@ -725,6 +730,7 @@ void checkForRequests() {
}
#ifdef ENABLE_HOMEASSISTANT
sendState();
}
#endif
free(payload);