From 5f9520b81ff68946aa1e0313c3d4b3e49be493d3 Mon Sep 17 00:00:00 2001 From: ludeeus Date: Mon, 22 Jul 2024 14:09:44 +0000 Subject: [PATCH] Unload cleanup --- custom_components/healthchecksio/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/healthchecksio/__init__.py b/custom_components/healthchecksio/__init__.py index 76f90a3..0dfb5c9 100644 --- a/custom_components/healthchecksio/__init__.py +++ b/custom_components/healthchecksio/__init__.py @@ -59,10 +59,9 @@ async def async_unload_entry( hass: core.HomeAssistant, config_entry: config_entries.ConfigEntry ) -> bool: """Unload a config entry.""" - unload_ok = await hass.config_entries.async_forward_entry_unload( - config_entry, Platform.BINARY_SENSOR - ) - if unload_ok: + if unload_ok := await hass.config_entries.async_unload_platforms( + config_entry, PLATFORMS + ): hass.data.pop(DOMAIN_DATA, None) LOGGER.info("Successfully removed the healthchecksio integration") return unload_ok