Skip to content

Commit

Permalink
Do not use async_config_entry_first_refresh in fastdotcom (home-assis…
Browse files Browse the repository at this point in the history
…tant#128152)

Do not use async_config_entry_first_refresh in fastdocom
  • Loading branch information
epenet authored Oct 13, 2024
1 parent 7e56b59 commit de47776
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions homeassistant/components/fastdotcom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit de47776

Please sign in to comment.