mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Clean up outdated entity replacement logic in Guardian (#107160)
This commit is contained in:
parent
99bcc38284
commit
3caaf2931f
@ -98,9 +98,6 @@ async def async_setup_entry(
|
|||||||
EntityDomainReplacementStrategy(
|
EntityDomainReplacementStrategy(
|
||||||
BINARY_SENSOR_DOMAIN,
|
BINARY_SENSOR_DOMAIN,
|
||||||
f"{uid}_ap_enabled",
|
f"{uid}_ap_enabled",
|
||||||
f"switch.guardian_valve_controller_{uid}_onboard_ap",
|
|
||||||
"2022.12.0",
|
|
||||||
remove_old_entity=True,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -29,9 +29,6 @@ class EntityDomainReplacementStrategy:
|
|||||||
|
|
||||||
old_domain: str
|
old_domain: str
|
||||||
old_unique_id: str
|
old_unique_id: str
|
||||||
replacement_entity_id: str
|
|
||||||
breaks_in_ha_version: str
|
|
||||||
remove_old_entity: bool = True
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
@ -55,9 +52,8 @@ def async_finish_entity_domain_replacements(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
old_entity_id = registry_entry.entity_id
|
old_entity_id = registry_entry.entity_id
|
||||||
if strategy.remove_old_entity:
|
LOGGER.info('Removing old entity: "%s"', old_entity_id)
|
||||||
LOGGER.info('Removing old entity: "%s"', old_entity_id)
|
ent_reg.async_remove(old_entity_id)
|
||||||
ent_reg.async_remove(old_entity_id)
|
|
||||||
|
|
||||||
|
|
||||||
class GuardianDataUpdateCoordinator(DataUpdateCoordinator[dict]):
|
class GuardianDataUpdateCoordinator(DataUpdateCoordinator[dict]):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user