Add brightness state to emulated hue when devices support only color temp and brightness (#31834)

This commit is contained in:
Slava 2020-03-13 23:42:47 +01:00 committed by GitHub
parent fd5895118e
commit 9db3900cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -677,7 +677,11 @@ def entity_to_json(config, entity):
retval["type"] = "Color temperature light" retval["type"] = "Color temperature light"
retval["modelid"] = "HASS312" retval["modelid"] = "HASS312"
retval["state"].update( retval["state"].update(
{HUE_API_STATE_COLORMODE: "ct", HUE_API_STATE_CT: state[STATE_COLOR_TEMP]} {
HUE_API_STATE_COLORMODE: "ct",
HUE_API_STATE_CT: state[STATE_COLOR_TEMP],
HUE_API_STATE_BRI: state[STATE_BRIGHTNESS],
}
) )
elif entity_features & ( elif entity_features & (
SUPPORT_BRIGHTNESS SUPPORT_BRIGHTNESS