From de47776ea5564e026ba160b3ad668e55d910f1ea Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:17:11 +0200 Subject: [PATCH] Do not use async_config_entry_first_refresh in fastdotcom (#128152) Do not use async_config_entry_first_refresh in fastdocom --- homeassistant/components/fastdotcom/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/fastdotcom/__init__.py b/homeassistant/components/fastdotcom/__init__.py index b9593ec907f54..967e7ef8e35f1 100644 --- a/homeassistant/components/fastdotcom/__init__.py +++ b/homeassistant/components/fastdotcom/__init__.py @@ -4,7 +4,7 @@ import logging -from homeassistant.config_entries import ConfigEntry +from homeassistant.config_entries import ConfigEntry, ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.helpers.start import async_at_started @@ -26,7 +26,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def _async_finish_startup(hass: HomeAssistant) -> None: """Run this only when HA has finished its startup.""" - await coordinator.async_config_entry_first_refresh() + if entry.state == ConfigEntryState.LOADED: + await coordinator.async_refresh() + else: + await coordinator.async_config_entry_first_refresh() # Don't start a speedtest during startup, this will slow down the overall startup dramatically async_at_started(hass, _async_finish_startup)