Skip to content

Commit

Permalink
fix: bool value false
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanPhevos authored and topsworld committed Dec 17, 2024
1 parent 18283ed commit ac5901b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/xiaomi_home/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
f'{self.entity_id}')
return
# set air-conditioner on
elif not self.get_prop_value(
prop=self._prop_on):
elif self.get_prop_value(prop=self._prop_on) is False:
await self.set_property_async(prop=self._prop_on, value=True)
# set mode
mode_value = self.get_map_value(
Expand Down Expand Up @@ -372,7 +371,7 @@ def current_humidity(self) -> Optional[int]:
@ property
def hvac_mode(self) -> Optional[HVACMode]:
"""Return the hvac mode. e.g., heat, cool mode."""
if not self.get_prop_value(prop=self._prop_on):
if self.get_prop_value(prop=self._prop_on) is False:
return HVACMode.OFF
return self.get_map_description(
map_=self._hvac_mode_map,
Expand Down

0 comments on commit ac5901b

Please sign in to comment.