From b22dfa119baabbdd1f41f1d49d82f560e9cbf5a6 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 31 Jan 2020 08:30:13 +0100 Subject: [PATCH] Emulated Hue: changed fallback device-type to fix Alexa compatibility issues (#30013) (#31330) * Emulated Hue: changed the reported fallback device-type to fix Alexa compatibility issues (#30013) * Emulated Hue: updated tests (#30013) --- homeassistant/components/emulated_hue/hue_api.py | 7 ++++--- tests/components/emulated_hue/test_hue_api.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/emulated_hue/hue_api.py b/homeassistant/components/emulated_hue/hue_api.py index 459a13c066c..118bf7e3eaa 100644 --- a/homeassistant/components/emulated_hue/hue_api.py +++ b/homeassistant/components/emulated_hue/hue_api.py @@ -704,9 +704,10 @@ def entity_to_json(config, entity): retval["modelid"] = "HASS123" retval["state"].update({HUE_API_STATE_BRI: state[STATE_BRIGHTNESS]}) else: - # On/off light (Zigbee Device ID: 0x0000) - # Supports groups, scenes and on/off control - retval["type"] = "On/off light" + # On/off plug-in unit (Zigbee Device ID: 0x0000) + # Supports groups and on/off control + # Used for compatibility purposes with Alexa instead of "On/off light" + retval["type"] = "On/off plug-in unit" retval["modelid"] = "HASS321" return retval diff --git a/tests/components/emulated_hue/test_hue_api.py b/tests/components/emulated_hue/test_hue_api.py index 349d53aaee5..0ddc429b2d9 100644 --- a/tests/components/emulated_hue/test_hue_api.py +++ b/tests/components/emulated_hue/test_hue_api.py @@ -238,7 +238,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["type"] == "On/off light" + assert light_without_brightness_json["type"] == "On/off plug-in unit" async def test_light_without_brightness_can_be_turned_off(hass_hue, hue_client):