mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Add TURN_ON/OFF ClimateEntityFeature for Matter (#108974)
* Add TURN_ON/OFF ClimateEntityFeature for Matter * Adjust matter
This commit is contained in:
parent
5a35c2e1e9
commit
b32371b5c9
@ -73,11 +73,8 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
||||
"""Representation of a Matter climate entity."""
|
||||
|
||||
_attr_temperature_unit: str = UnitOfTemperature.CELSIUS
|
||||
_attr_supported_features: ClimateEntityFeature = (
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||
)
|
||||
_attr_hvac_mode: HVACMode = HVACMode.OFF
|
||||
_enable_turn_on_off_backwards_compatibility = False
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -99,6 +96,13 @@ class MatterClimate(MatterEntity, ClimateEntity):
|
||||
self._attr_hvac_modes.append(HVACMode.COOL)
|
||||
if feature_map & ThermostatFeature.kAutoMode:
|
||||
self._attr_hvac_modes.append(HVACMode.HEAT_COOL)
|
||||
self._attr_supported_features = (
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
||||
| ClimateEntityFeature.TURN_OFF
|
||||
)
|
||||
if any(mode for mode in self.hvac_modes if mode != HVACMode.OFF):
|
||||
self._attr_supported_features |= ClimateEntityFeature.TURN_ON
|
||||
|
||||
async def async_set_temperature(self, **kwargs: Any) -> None:
|
||||
"""Set new target temperature."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user