From ac5901bf1f50da189dbfa36d2b5ad9735f8ba020 Mon Sep 17 00:00:00 2001 From: LiShuzhen Date: Tue, 17 Dec 2024 17:57:02 +0800 Subject: [PATCH] fix: bool value false --- custom_components/xiaomi_home/climate.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/xiaomi_home/climate.py b/custom_components/xiaomi_home/climate.py index a1d2ad4..cc12373 100644 --- a/custom_components/xiaomi_home/climate.py +++ b/custom_components/xiaomi_home/climate.py @@ -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( @@ -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,