mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix Matter climate platform attributes when dedicated OnOff attribute is off (#126286)
This commit is contained in:
parent
7658ed8eaa
commit
2322d071e4
@ -190,11 +190,12 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
||||
# if the mains power is off - treat it as if the HVAC mode is off
|
||||
self._attr_hvac_mode = HVACMode.OFF
|
||||
self._attr_hvac_action = None
|
||||
return
|
||||
|
||||
else:
|
||||
# update hvac_mode from SystemMode
|
||||
system_mode_value = int(
|
||||
self.get_matter_attribute_value(clusters.Thermostat.Attributes.SystemMode)
|
||||
self.get_matter_attribute_value(
|
||||
clusters.Thermostat.Attributes.SystemMode
|
||||
)
|
||||
)
|
||||
match system_mode_value:
|
||||
case SystemModeEnum.kAuto:
|
||||
@ -220,9 +221,15 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
||||
clusters.Thermostat.Attributes.ThermostatRunningState
|
||||
):
|
||||
match running_state_value:
|
||||
case ThermostatRunningState.Heat | ThermostatRunningState.HeatStage2:
|
||||
case (
|
||||
ThermostatRunningState.Heat
|
||||
| ThermostatRunningState.HeatStage2
|
||||
):
|
||||
self._attr_hvac_action = HVACAction.HEATING
|
||||
case ThermostatRunningState.Cool | ThermostatRunningState.CoolStage2:
|
||||
case (
|
||||
ThermostatRunningState.Cool
|
||||
| ThermostatRunningState.CoolStage2
|
||||
):
|
||||
self._attr_hvac_action = HVACAction.COOLING
|
||||
case (
|
||||
ThermostatRunningState.Fan
|
||||
@ -232,6 +239,7 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
||||
self._attr_hvac_action = HVACAction.FAN
|
||||
case _:
|
||||
self._attr_hvac_action = HVACAction.OFF
|
||||
|
||||
# update target temperature high/low
|
||||
supports_range = (
|
||||
self._attr_supported_features
|
||||
|
Loading…
x
Reference in New Issue
Block a user