From 738ae1aaab2ef4b3f9797fe493efafcd608c3c81 Mon Sep 17 00:00:00 2001 From: Tim Lunn Date: Thu, 3 Oct 2024 12:40:05 +0000 Subject: [PATCH] fix update tests --- tests/components/smlight/test_update.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/components/smlight/test_update.py b/tests/components/smlight/test_update.py index 7bff12bb027a8..c1739002bc899 100644 --- a/tests/components/smlight/test_update.py +++ b/tests/components/smlight/test_update.py @@ -1,5 +1,6 @@ """Tests for the SMLIGHT update platform.""" +from datetime import timedelta from unittest.mock import MagicMock from freezegun.api import FrozenDateTimeFactory @@ -124,7 +125,7 @@ async def test_update_firmware( sw_version="v2.5.2", ) - freezer.tick(SCAN_FIRMWARE_INTERVAL) + freezer.tick(timedelta(seconds=5)) async_fire_time_changed(hass) await hass.async_block_till_done() @@ -209,6 +210,7 @@ async def _call_event_function(event: MessageEvent): with pytest.raises(HomeAssistantError): await _call_event_function(MOCK_FIRMWARE_FAIL) + state = hass.states.get(entity_id) assert state.attributes[ATTR_IN_PROGRESS] is False