mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Don't advertise switch devices as dimmable lights (#37978)
This issue has been corrected and then reverted multiple times. It seems that the core issue was a casing one (On/off vs On/Off) ; for better matching with a real Hue hub, also add the productname. Tested to work with echo 2 and echo 5.
This commit is contained in:
parent
6ea5c8aed9
commit
36ee9ff58f
@ -744,12 +744,11 @@ def entity_to_json(config, entity):
|
|||||||
retval["modelid"] = "HASS123"
|
retval["modelid"] = "HASS123"
|
||||||
retval["state"].update({HUE_API_STATE_BRI: state[STATE_BRIGHTNESS]})
|
retval["state"].update({HUE_API_STATE_BRI: state[STATE_BRIGHTNESS]})
|
||||||
else:
|
else:
|
||||||
# Dimmable light (Zigbee Device ID: 0x0100)
|
# On/Off light (ZigBee Device ID: 0x0000)
|
||||||
# Supports groups, scenes, on/off and dimming
|
# Supports groups, scenes and on/off control
|
||||||
# Reports fixed brightness for compatibility with Alexa.
|
retval["type"] = "On/Off light"
|
||||||
retval["type"] = "Dimmable light"
|
retval["productname"] = "On/Off light"
|
||||||
retval["modelid"] = "HASS123"
|
retval["modelid"] = "HASS321"
|
||||||
retval["state"].update({HUE_API_STATE_BRI: HUE_API_STATE_BRI_MAX})
|
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ 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["state"][HUE_API_STATE_ON] is True
|
||||||
assert light_without_brightness_json["type"] == "Dimmable light"
|
assert light_without_brightness_json["type"] == "On/Off light"
|
||||||
|
|
||||||
|
|
||||||
async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client):
|
async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user