diff --git a/tests/components/zha/conftest.py b/tests/components/zha/conftest.py index 97388fd17cc..e75a84406d6 100644 --- a/tests/components/zha/conftest.py +++ b/tests/components/zha/conftest.py @@ -520,10 +520,10 @@ def network_backup() -> zigpy.backups.NetworkBackup: @pytest.fixture -def core_rs(hass_storage: dict[str, Any]): +def core_rs(hass_storage: dict[str, Any]) -> Callable[[str, Any, dict[str, Any]], None]: """Core.restore_state fixture.""" - def _storage(entity_id, state, attributes={}): + def _storage(entity_id: str, state: str, attributes: dict[str, Any]) -> None: now = dt_util.utcnow().isoformat() hass_storage[restore_state.STORAGE_KEY] = { diff --git a/tests/components/zha/test_binary_sensor.py b/tests/components/zha/test_binary_sensor.py index bd9262a41ce..8276223926d 100644 --- a/tests/components/zha/test_binary_sensor.py +++ b/tests/components/zha/test_binary_sensor.py @@ -1,5 +1,7 @@ """Test ZHA binary sensor.""" +from collections.abc import Callable +from typing import Any from unittest.mock import patch import pytest @@ -158,9 +160,9 @@ async def test_binary_sensor( async def test_onoff_binary_sensor_restore_state( hass: HomeAssistant, zigpy_device_mock, - core_rs, + core_rs: Callable[[str, Any, dict[str, Any]], None], zha_device_restored, - restored_state, + restored_state: str, ) -> None: """Test ZHA OnOff binary_sensor restores last state from HA.""" diff --git a/tests/components/zha/test_light.py b/tests/components/zha/test_light.py index 5d50d708ed6..fda5971cbf7 100644 --- a/tests/components/zha/test_light.py +++ b/tests/components/zha/test_light.py @@ -1,6 +1,8 @@ """Test ZHA light.""" +from collections.abc import Callable from datetime import timedelta +from typing import Any from unittest.mock import AsyncMock, call, patch, sentinel import pytest @@ -1962,10 +1964,10 @@ async def test_group_member_assume_state( async def test_restore_light_state( hass: HomeAssistant, zigpy_device_mock, - core_rs, + core_rs: Callable[[str, Any, dict[str, Any]], None], zha_device_restored, - restored_state, - expected_state, + restored_state: str, + expected_state: dict[str, Any], ) -> None: """Test ZHA light restores without throwing an error when attributes are None."""