mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix webostv YAML migration failure if the entity is removed (#64290)
* Fix webostv YAML migration failure if the entity is removed * Update homeassistant/components/webostv/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * use new entity_id for unique_id update Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
a2e1cd2632
commit
57bd8a7a4a
@ -166,8 +166,20 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
ent_reg = entity_registry.async_get(hass)
|
||||||
|
if not (
|
||||||
|
new_entity_id := ent_reg.async_get_entity_id(
|
||||||
|
Platform.MEDIA_PLAYER, DOMAIN, key
|
||||||
|
)
|
||||||
|
):
|
||||||
|
_LOGGER.debug(
|
||||||
|
"Not updating webOSTV Smart TV entity %s unique_id, entity missing",
|
||||||
|
entity_id,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
uuid = client.hello_info["deviceUUID"]
|
uuid = client.hello_info["deviceUUID"]
|
||||||
ent_reg.async_update_entity(entity_id, new_unique_id=uuid)
|
ent_reg.async_update_entity(new_entity_id, new_unique_id=uuid)
|
||||||
await hass.config_entries.flow.async_init(
|
await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": SOURCE_IMPORT},
|
context={"source": SOURCE_IMPORT},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user