mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-17 15:22:12 +08:00
fix: thermostat on/off
This commit is contained in:
parent
ff984fae33
commit
fe3e1b4005
@ -120,8 +120,11 @@ class FeatureOnOff(MIoTServiceEntity, ClimateEntity):
|
|||||||
for prop in entity_data.props:
|
for prop in entity_data.props:
|
||||||
if prop.name == 'on':
|
if prop.name == 'on':
|
||||||
if (
|
if (
|
||||||
|
# The "on" property of the "fan-control" service is not
|
||||||
|
# the on/off feature of the entity.
|
||||||
prop.service.name == 'air-conditioner'
|
prop.service.name == 'air-conditioner'
|
||||||
or prop.service.name == 'heater'
|
or prop.service.name == 'heater'
|
||||||
|
or prop.service.name == 'thermostat'
|
||||||
):
|
):
|
||||||
self._attr_supported_features |= (
|
self._attr_supported_features |= (
|
||||||
ClimateEntityFeature.TURN_ON
|
ClimateEntityFeature.TURN_ON
|
||||||
@ -634,10 +637,14 @@ class AirConditioner(
|
|||||||
"""The current hvac mode."""
|
"""The current hvac mode."""
|
||||||
if self.get_prop_value(prop=self._prop_on) is False:
|
if self.get_prop_value(prop=self._prop_on) is False:
|
||||||
return HVACMode.OFF
|
return HVACMode.OFF
|
||||||
return self.get_map_description(
|
return (
|
||||||
map_=self._hvac_mode_map,
|
self.get_map_description(
|
||||||
key=self.get_prop_value(prop=self._prop_mode)
|
map_=self._hvac_mode_map,
|
||||||
) if self._prop_mode else None
|
key=self.get_prop_value(prop=self._prop_mode),
|
||||||
|
)
|
||||||
|
if self._prop_mode
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
|
||||||
def __ac_state_changed(self, prop: MIoTSpecProperty, value: Any) -> None:
|
def __ac_state_changed(self, prop: MIoTSpecProperty, value: Any) -> None:
|
||||||
del prop
|
del prop
|
||||||
|
|||||||
@ -228,7 +228,8 @@ SPEC_DEVICE_TRANS_MAP: dict[str, dict | str] = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'optional': {
|
'optional': {
|
||||||
'properties': {'target-temperature', 'mode', 'fan-level'}
|
'properties': {'target-temperature', 'mode', 'fan-level',
|
||||||
|
'temperature'}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user