From 96525cbca5057458fd774e3abf141216d5000ba9 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Tue, 2 Jul 2024 17:17:37 +0200 Subject: [PATCH] add test for fan --- tests/components/matter/test_fan.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/components/matter/test_fan.py b/tests/components/matter/test_fan.py index 30bd7f4a00967..7e964d672ca3d 100644 --- a/tests/components/matter/test_fan.py +++ b/tests/components/matter/test_fan.py @@ -92,6 +92,12 @@ async def test_fan_base( await trigger_subscription_callback(hass, matter_client) state = hass.states.get(entity_id) assert state.attributes["preset_mode"] == "sleep_wind" + # set mains power to OFF (OnOff cluster) + set_node_attribute(air_purifier, 1, 6, 0, False) + await trigger_subscription_callback(hass, matter_client) + state = hass.states.get(entity_id) + assert state.attributes["preset_mode"] is None + assert state.attributes["percentage"] == 0 async def test_fan_turn_on_with_percentage(