From 69a22006c837376401916d955322b96dd6dda122 Mon Sep 17 00:00:00 2001 From: Deb Date: Wed, 28 Feb 2018 12:55:29 -0500 Subject: [PATCH] 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. --- Arduino/McLighting/request_handlers.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Arduino/McLighting/request_handlers.h b/Arduino/McLighting/request_handlers.h index be3b691..591b6c4 100644 --- a/Arduino/McLighting/request_handlers.h +++ b/Arduino/McLighting/request_handlers.h @@ -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);