Fix Hue migration (#61030)

This commit is contained in:
Marcel van der Veldt 2021-12-05 18:47:24 +01:00 committed by GitHub
parent 3eeb855679
commit 11e2f51681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,6 +166,9 @@ async def handle_v2_migration(hass: core.HomeAssistant, entry: ConfigEntry) -> N
continue continue
v1_id = f"/groups/{ent.unique_id}" v1_id = f"/groups/{ent.unique_id}"
hue_group = api.groups.room.get_by_v1_id(v1_id) hue_group = api.groups.room.get_by_v1_id(v1_id)
if hue_group is None or hue_group.grouped_light is None:
# try again with zone
hue_group = api.groups.zone.get_by_v1_id(v1_id)
if hue_group is None or hue_group.grouped_light is None: if hue_group is None or hue_group.grouped_light is None:
# this may happen if we're looking at some orphaned entity # this may happen if we're looking at some orphaned entity
LOGGER.warning( LOGGER.warning(