mirror of
https://github.com/home-assistant/core
synced 2024-10-08 14:48:22 +00:00
Fix emulated hue on/off devices compatibility with alexa (#39063)
This commit is contained in:
parent
28a9793a7b
commit
4371068f6a
|
@ -780,6 +780,7 @@ def entity_to_json(config, entity):
|
|||
retval["type"] = "On/Off light"
|
||||
retval["productname"] = "On/Off light"
|
||||
retval["modelid"] = "HASS321"
|
||||
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX})
|
||||
|
||||
return retval
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ from homeassistant.components import (
|
|||
from homeassistant.components.emulated_hue import Config, hue_api
|
||||
from homeassistant.components.emulated_hue.hue_api import (
|
||||
HUE_API_STATE_BRI,
|
||||
HUE_API_STATE_BRI_MAX,
|
||||
HUE_API_STATE_CT,
|
||||
HUE_API_STATE_HUE,
|
||||
HUE_API_STATE_ON,
|
||||
|
@ -282,6 +283,12 @@ async def test_light_without_brightness_supported(hass_hue, hue_client):
|
|||
assert light_without_brightness_json["state"][HUE_API_STATE_ON] is True
|
||||
assert light_without_brightness_json["type"] == "On/Off light"
|
||||
|
||||
# BRI required for alexa compat
|
||||
assert (
|
||||
light_without_brightness_json["state"][HUE_API_STATE_BRI]
|
||||
== HUE_API_STATE_BRI_MAX
|
||||
)
|
||||
|
||||
|
||||
async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client):
|
||||
"""Test that light without brightness can be turned off."""
|
||||
|
|
Loading…
Reference in a new issue