mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Schedule polling as periodic tasks (#112640)
* Schedule periodic coordinator updates as background tasks. Currently, the coordinator's periodic refreshes delay startup because they are not scheduled as background tasks. We will wait if the startup takes long enough for the first planned refresh. Another coordinator's scheduled refresh will be fired on busy systems, further delaying the startup. This chain of events results in the startup taking a long time and hitting the safety timeout because too many coordinators are refreshing. This case can also happen with scheduled entity refreshes, but it's less common. A future PR will address that case. * periodic_tasks * periodic_tasks * periodic_tasks * merge * merge * merge * merge * merge * fix test that call the sync api from async * one more place * cannot chain * async_run_periodic_hass_job * sun and pattern time changes from automations also block startup * Revert "sun and pattern time changes from automations also block startup" This reverts commit6de2defa05. * make sure polling is cancelled when config entry is unloaded * Revert "Revert "sun and pattern time changes from automations also block startup"" This reverts commite8f12aad55. * remove DisabledError from homewizard test as it relies on a race * fix race * direct coverage
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from homewizard_energy.errors import DisabledError, RequestError
|
||||
from homewizard_energy.errors import RequestError
|
||||
from homewizard_energy.models import Data
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
@@ -375,7 +375,7 @@ async def test_disabled_by_default_sensors(
|
||||
assert entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
|
||||
|
||||
|
||||
@pytest.mark.parametrize("exception", [RequestError, DisabledError])
|
||||
@pytest.mark.parametrize("exception", [RequestError])
|
||||
async def test_sensors_unreachable(
|
||||
hass: HomeAssistant,
|
||||
mock_homewizardenergy: MagicMock,
|
||||
|
||||
Reference in New Issue
Block a user