From deb4db8f1633a0c78d542c4f33959990880cc424 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Thu, 27 Jun 2024 13:45:02 +0200 Subject: [PATCH] Migrate to async_forward_entry_setups (#51) --- custom_components/healthchecksio/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/custom_components/healthchecksio/__init__.py b/custom_components/healthchecksio/__init__.py index 08f3738..4e8afe9 100644 --- a/custom_components/healthchecksio/__init__.py +++ b/custom_components/healthchecksio/__init__.py @@ -27,6 +27,9 @@ ) MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=300) +PLATFORMS = [ + Platform.BINARY_SENSOR, +] async def async_setup(hass: core.HomeAssistant, config: ConfigType): @@ -73,13 +76,7 @@ async def async_setup_entry( hass, api_key, check, self_hosted, site_root, ping_endpoint ) - # Add binary_sensor - hass.async_add_job( - hass.config_entries.async_forward_entry_setup( - config_entry, Platform.BINARY_SENSOR - ) - ) - + await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) return True