Handle mains power for Matter appliances (#121023)

This commit is contained in:
Marcel van der Veldt 2024-07-02 21:02:29 +02:00 committed by GitHub
parent ba7e45e157
commit 52627b9aed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 3 deletions

View file

@ -315,14 +315,19 @@ async def test_room_airconditioner(
state = hass.states.get("climate.room_airconditioner_thermostat")
assert state
assert state.attributes["current_temperature"] == 20
assert state.attributes["min_temp"] == 16
assert state.attributes["max_temp"] == 32
# room airconditioner has mains power on OnOff cluster with value set to False
assert state.state == HVACMode.OFF
# test supported features correctly parsed
# WITHOUT temperature_range support
mask = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.TURN_OFF
assert state.attributes["supported_features"] & mask == mask
# set mains power to ON (OnOff cluster)
set_node_attribute(room_airconditioner, 1, 6, 0, True)
await trigger_subscription_callback(hass, matter_client)
state = hass.states.get("climate.room_airconditioner_thermostat")
# test supported HVAC modes include fan and dry modes
assert state.attributes["hvac_modes"] == [
HVACMode.OFF,