Clean up outdated entity replacement logic in Guardian (#107160)

This commit is contained in:
Aaron Bach 2024-01-04 13:50:45 -07:00 committed by GitHub
parent 99bcc38284
commit 3caaf2931f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -98,9 +98,6 @@ async def async_setup_entry(
EntityDomainReplacementStrategy(
BINARY_SENSOR_DOMAIN,
f"{uid}_ap_enabled",
f"switch.guardian_valve_controller_{uid}_onboard_ap",
"2022.12.0",
remove_old_entity=True,
),
),
)

View File

@ -29,9 +29,6 @@ class EntityDomainReplacementStrategy:
old_domain: str
old_unique_id: str
replacement_entity_id: str
breaks_in_ha_version: str
remove_old_entity: bool = True
@callback
@ -55,9 +52,8 @@ def async_finish_entity_domain_replacements(
continue
old_entity_id = registry_entry.entity_id
if strategy.remove_old_entity:
LOGGER.info('Removing old entity: "%s"', old_entity_id)
ent_reg.async_remove(old_entity_id)
LOGGER.info('Removing old entity: "%s"', old_entity_id)
ent_reg.async_remove(old_entity_id)
class GuardianDataUpdateCoordinator(DataUpdateCoordinator[dict]):