mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Fix name migration of the Xiaomi Miio humidifier (#53790)
This commit is contained in:
parent
370799bd22
commit
c6a2e247fe
@ -99,7 +99,6 @@ async def async_create_miio_device_and_coordinator(
|
|||||||
token = entry.data[CONF_TOKEN]
|
token = entry.data[CONF_TOKEN]
|
||||||
name = entry.title
|
name = entry.title
|
||||||
device = None
|
device = None
|
||||||
migrate_entity_name = None
|
|
||||||
|
|
||||||
if model not in MODELS_HUMIDIFIER:
|
if model not in MODELS_HUMIDIFIER:
|
||||||
return
|
return
|
||||||
@ -116,8 +115,8 @@ async def async_create_miio_device_and_coordinator(
|
|||||||
entity_id = entity_registry.async_get_entity_id("fan", DOMAIN, entry.unique_id)
|
entity_id = entity_registry.async_get_entity_id("fan", DOMAIN, entry.unique_id)
|
||||||
if entity_id:
|
if entity_id:
|
||||||
# This check is entities that have a platform migration only and should be removed in the future
|
# This check is entities that have a platform migration only and should be removed in the future
|
||||||
migrate_entity_name = entity_registry.async_get(entity_id).name
|
if migrate_entity_name := entity_registry.async_get(entity_id).name:
|
||||||
hass.config_entries.async_update_entry(entry, title=migrate_entity_name)
|
hass.config_entries.async_update_entry(entry, title=migrate_entity_name)
|
||||||
entity_registry.async_remove(entity_id)
|
entity_registry.async_remove(entity_id)
|
||||||
|
|
||||||
async def async_update_data():
|
async def async_update_data():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user