diff --git a/code/espurna/homeassistant.ino b/code/espurna/homeassistant.ino index e80fe2db..ce164184 100644 --- a/code/espurna/homeassistant.ino +++ b/code/espurna/homeassistant.ino @@ -430,6 +430,19 @@ void _haConfigure() { const bool enabled = getSetting("haEnabled", HOMEASSISTANT_ENABLED).toInt() == 1; _ha_send_flag = (enabled != _ha_enabled); _ha_enabled = enabled; + + // https://github.com/xoseperez/espurna/issues/1273 + // https://gitter.im/tinkerman-cat/espurna?at=5df8ad4655d9392300268a8c + // TODO: ensure that this is called before _lightConfigure() + // in case useCSS value is ever cached by the lights module + #if LIGHT_PROVIDER != LIGHT_PROVIDER_NONE + if (enabled) { + if (getSetting("useCSS", LIGHT_USE_CSS).toInt() == 1) { + setSetting("useCSS", 0); + } + } + #endif + _haSend(); } diff --git a/code/html/index.html b/code/html/index.html index 83909788..0bdcdc7b 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -536,7 +536,12 @@
-
Use CSS style to report colors to MQTT and REST API.
Red will be reported as "#FF0000" if ON, otherwise "255,0,0"
+
+
+ WARNING! Incompatible with Home Assistant MQTT integration +
+ Use CSS style to report colors to MQTT and REST API.
Red will be reported as "#FF0000" if ON, otherwise "255,0,0" +
@@ -1270,9 +1275,6 @@
Home Assistant auto-discovery feature. Enable and save to add the device to your HA console. - - When using a colour light you might want to disable CSS style so Home Assistant can parse the color. -