mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Fix async_config_entry_first_refresh used after config entry is loaded in speedtestdotcom (#129527)
* Fix async_config_entry_first_refresh used after config entry is loaded in speedtestdotcom * is
This commit is contained in:
parent
bf3f1b4b49
commit
d7e304badf
@ -6,7 +6,7 @@ from functools import partial
|
|||||||
|
|
||||||
import speedtest
|
import speedtest
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
@ -35,6 +35,9 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
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 config_entry.state is 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
|
# Don't start a speedtest during startup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user