From 8ab627cd44ab08a22db85ff5d4ecac55545bd2e9 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Wed, 12 Feb 2025 11:53:35 +0100 Subject: [PATCH] Fix test typing --- tests/components/tradfri/common.py | 2 +- tests/components/tradfri/test_light.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/components/tradfri/common.py b/tests/components/tradfri/common.py index 55e56bb9f72..a9a6e616b58 100644 --- a/tests/components/tradfri/common.py +++ b/tests/components/tradfri/common.py @@ -28,7 +28,7 @@ class CommandStore: """Register device response.""" get_devices_command = gateway.get_devices() self.register_response(get_devices_command, [device_response.id]) - get_device_command = gateway.get_device(device_response.id) + get_device_command = gateway.get_device(str(device_response.id)) self.register_response(get_device_command, device_response.dict(by_alias=True)) def register_response(self, command: Command, response: Any) -> None: diff --git a/tests/components/tradfri/test_light.py b/tests/components/tradfri/test_light.py index bf4c5696de0..52c2c26c08b 100644 --- a/tests/components/tradfri/test_light.py +++ b/tests/components/tradfri/test_light.py @@ -246,7 +246,9 @@ async def test_turn_on( ) -> None: """Test turning on a light.""" # Make sure the light is off. - device.raw.light_control[0].state = 0 + light_control = device.raw.light_control + assert light_control + light_control[0].state = 0 await setup_integration(hass) await hass.services.async_call(