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,48 +190,56 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
|||||||
# if the mains power is off - treat it as if the HVAC mode is off
|
# if the mains power is off - treat it as if the HVAC mode is off
|
||||||
self._attr_hvac_mode = HVACMode.OFF
|
self._attr_hvac_mode = HVACMode.OFF
|
||||||
self._attr_hvac_action = None
|
self._attr_hvac_action = None
|
||||||
return
|
else:
|
||||||
|
# update hvac_mode from SystemMode
|
||||||
# update hvac_mode from SystemMode
|
system_mode_value = int(
|
||||||
system_mode_value = int(
|
self.get_matter_attribute_value(
|
||||||
self.get_matter_attribute_value(clusters.Thermostat.Attributes.SystemMode)
|
clusters.Thermostat.Attributes.SystemMode
|
||||||
)
|
)
|
||||||
match system_mode_value:
|
)
|
||||||
case SystemModeEnum.kAuto:
|
match system_mode_value:
|
||||||
self._attr_hvac_mode = HVACMode.HEAT_COOL
|
case SystemModeEnum.kAuto:
|
||||||
case SystemModeEnum.kDry:
|
self._attr_hvac_mode = HVACMode.HEAT_COOL
|
||||||
self._attr_hvac_mode = HVACMode.DRY
|
case SystemModeEnum.kDry:
|
||||||
case SystemModeEnum.kFanOnly:
|
self._attr_hvac_mode = HVACMode.DRY
|
||||||
self._attr_hvac_mode = HVACMode.FAN_ONLY
|
case SystemModeEnum.kFanOnly:
|
||||||
case SystemModeEnum.kCool | SystemModeEnum.kPrecooling:
|
self._attr_hvac_mode = HVACMode.FAN_ONLY
|
||||||
self._attr_hvac_mode = HVACMode.COOL
|
case SystemModeEnum.kCool | SystemModeEnum.kPrecooling:
|
||||||
case SystemModeEnum.kHeat | SystemModeEnum.kEmergencyHeat:
|
self._attr_hvac_mode = HVACMode.COOL
|
||||||
self._attr_hvac_mode = HVACMode.HEAT
|
case SystemModeEnum.kHeat | SystemModeEnum.kEmergencyHeat:
|
||||||
case SystemModeEnum.kFanOnly:
|
self._attr_hvac_mode = HVACMode.HEAT
|
||||||
self._attr_hvac_mode = HVACMode.FAN_ONLY
|
case SystemModeEnum.kFanOnly:
|
||||||
case SystemModeEnum.kDry:
|
self._attr_hvac_mode = HVACMode.FAN_ONLY
|
||||||
self._attr_hvac_mode = HVACMode.DRY
|
case SystemModeEnum.kDry:
|
||||||
case _:
|
self._attr_hvac_mode = HVACMode.DRY
|
||||||
self._attr_hvac_mode = HVACMode.OFF
|
|
||||||
# running state is an optional attribute
|
|
||||||
# which we map to hvac_action if it exists (its value is not None)
|
|
||||||
self._attr_hvac_action = None
|
|
||||||
if running_state_value := self.get_matter_attribute_value(
|
|
||||||
clusters.Thermostat.Attributes.ThermostatRunningState
|
|
||||||
):
|
|
||||||
match running_state_value:
|
|
||||||
case ThermostatRunningState.Heat | ThermostatRunningState.HeatStage2:
|
|
||||||
self._attr_hvac_action = HVACAction.HEATING
|
|
||||||
case ThermostatRunningState.Cool | ThermostatRunningState.CoolStage2:
|
|
||||||
self._attr_hvac_action = HVACAction.COOLING
|
|
||||||
case (
|
|
||||||
ThermostatRunningState.Fan
|
|
||||||
| ThermostatRunningState.FanStage2
|
|
||||||
| ThermostatRunningState.FanStage3
|
|
||||||
):
|
|
||||||
self._attr_hvac_action = HVACAction.FAN
|
|
||||||
case _:
|
case _:
|
||||||
self._attr_hvac_action = HVACAction.OFF
|
self._attr_hvac_mode = HVACMode.OFF
|
||||||
|
# running state is an optional attribute
|
||||||
|
# which we map to hvac_action if it exists (its value is not None)
|
||||||
|
self._attr_hvac_action = None
|
||||||
|
if running_state_value := self.get_matter_attribute_value(
|
||||||
|
clusters.Thermostat.Attributes.ThermostatRunningState
|
||||||
|
):
|
||||||
|
match running_state_value:
|
||||||
|
case (
|
||||||
|
ThermostatRunningState.Heat
|
||||||
|
| ThermostatRunningState.HeatStage2
|
||||||
|
):
|
||||||
|
self._attr_hvac_action = HVACAction.HEATING
|
||||||
|
case (
|
||||||
|
ThermostatRunningState.Cool
|
||||||
|
| ThermostatRunningState.CoolStage2
|
||||||
|
):
|
||||||
|
self._attr_hvac_action = HVACAction.COOLING
|
||||||
|
case (
|
||||||
|
ThermostatRunningState.Fan
|
||||||
|
| ThermostatRunningState.FanStage2
|
||||||
|
| ThermostatRunningState.FanStage3
|
||||||
|
):
|
||||||
|
self._attr_hvac_action = HVACAction.FAN
|
||||||
|
case _:
|
||||||
|
self._attr_hvac_action = HVACAction.OFF
|
||||||
|
|
||||||
# update target temperature high/low
|
# update target temperature high/low
|
||||||
supports_range = (
|
supports_range = (
|
||||||
self._attr_supported_features
|
self._attr_supported_features
|
||||||
|
Loading…
x
Reference in New Issue
Block a user