Provide compatibility with older Home Assistant installations. (#39539)

Prior 0.113 all lights and switches were reported as dimmable devices and this was fixed by #37978.
However, under some circumstances Alexa will not smoothly transition from those broken devices to the new ones as it cache the list of entities.
It is imperative to have Alexa rediscover all devices and then remove the now non-responding duplicates using the Alexa phone App. This can take quite a while if you have lots of devices.
An alternative would be to log to the Alexa web site and remove all the lights instead and then re-discover them all.

If you have multiple echo devices on your network, it is possible that the entries would continue to show as duplicates. This is due to an individual echo devices caching the old list and re-using it.
The only known solution for this is to remove your echo devices from your Amazon account and re-add them.
After that, have Alexa rediscover all your devices.

This is a one-off requirement.

Fixes #39503
This commit is contained in:
Jean-Yves Avenard authored and GitHub committed 2020-09-01 09:16:40 -05:00
1 parent 762537d82d
commit cf4b6307ae
3 files changed
+47 -2

No files matched your search

+31 -1
View File
@@ -283,7 +283,37 @@ 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
async def test_lights_all_dimmable(hass, aiohttp_client):
"""Test CONF_LIGHTS_ALL_DIMMABLE."""
# create a lamp without brightness support
hass.states.async_set("light.no_brightness", "on", {})
await setup.async_setup_component(
hass, http.DOMAIN, {http.DOMAIN: {http.CONF_SERVER_PORT: HTTP_SERVER_PORT}}
)
await hass.async_block_till_done()
hue_config = {
emulated_hue.CONF_LISTEN_PORT: BRIDGE_SERVER_PORT,
emulated_hue.CONF_EXPOSE_BY_DEFAULT: True,
emulated_hue.CONF_LIGHTS_ALL_DIMMABLE: True,
}
with patch("homeassistant.components.emulated_hue.create_upnp_datagram_endpoint"):
await setup.async_setup_component(
hass,
emulated_hue.DOMAIN,
{emulated_hue.DOMAIN: hue_config},
)
await hass.async_block_till_done()
config = Config(None, hue_config)
config.numbers = ENTITY_IDS_BY_NUMBER
web_app = hass.http.app
HueOneLightStateView(config).register(web_app, web_app.router)
client = await aiohttp_client(web_app)
light_without_brightness_json = await perform_get_light_state(
client, "light.no_brightness", HTTP_OK
)
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["state"][HUE_API_STATE_BRI]
== HUE_API_STATE_BRI_MAX