Deprecate ISY994 custom cleanup entities service (#85931)

This commit is contained in:
shbatm 2023-01-16 01:14:41 -06:00 committed by GitHub
parent dfc33f858a
commit 176eb01016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,6 +320,13 @@ def async_setup_services(hass: HomeAssistant) -> None: # noqa: C901
@callback
def async_cleanup_registry_entries(service: ServiceCall) -> None:
"""Remove extra entities that are no longer part of the integration."""
async_log_deprecated_service_call(
hass,
call=service,
alternate_service="isy994.reload",
alternate_target=None,
breaks_in_ha_version="2023.5.0",
)
for config_entry_id in hass.data[DOMAIN]:
_async_cleanup_registry_entries(hass, config_entry_id)
@ -492,13 +499,17 @@ def async_log_deprecated_service_call(
},
)
alternate_text = ""
if alternate_target:
alternate_text = f' and pass it a target entity ID of "{alternate_target}"'
_LOGGER.warning(
(
'The "%s" service is deprecated and will be removed in %s; use the "%s" '
'service and pass it a target entity ID of "%s"'
"service %s"
),
deprecated_service,
breaks_in_ha_version,
alternate_service,
alternate_target,
alternate_text,
)