mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Do not use async_config_entry_first_refresh in fastdotcom (#128152)
Do not use async_config_entry_first_refresh in fastdocom
This commit is contained in:
parent
7e56b595a0
commit
de47776ea5
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.start import async_at_started
|
from homeassistant.helpers.start import async_at_started
|
||||||
|
|
||||||
@ -26,6 +26,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
async def _async_finish_startup(hass: HomeAssistant) -> None:
|
async def _async_finish_startup(hass: HomeAssistant) -> None:
|
||||||
"""Run this only when HA has finished its startup."""
|
"""Run this only when HA has finished its startup."""
|
||||||
|
if entry.state == ConfigEntryState.LOADED:
|
||||||
|
await coordinator.async_refresh()
|
||||||
|
else:
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
# Don't start a speedtest during startup, this will slow down the overall startup dramatically
|
# Don't start a speedtest during startup, this will slow down the overall startup dramatically
|
||||||
|
Loading…
x
Reference in New Issue
Block a user