From df164868bf8d753843b3b83ef35a6fb55027fa6b Mon Sep 17 00:00:00 2001 From: LiShuzhen Date: Mon, 3 Mar 2025 13:15:35 +0800 Subject: [PATCH] fix: wind-reverse format type --- custom_components/xiaomi_home/fan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_home/fan.py b/custom_components/xiaomi_home/fan.py index 0f64aa8..1d15c9b 100644 --- a/custom_components/xiaomi_home/fan.py +++ b/custom_components/xiaomi_home/fan.py @@ -172,7 +172,7 @@ class Fan(MIoTServiceEntity, FanEntity): self._attr_supported_features |= FanEntityFeature.OSCILLATE self._prop_horizontal_swing = prop elif prop.name == 'wind-reverse': - if prop.format_ == 'bool': + if prop.format_ == bool: self._prop_wind_reverse_forward = False self._prop_wind_reverse_reverse = True elif prop.value_list: @@ -186,7 +186,7 @@ class Fan(MIoTServiceEntity, FanEntity): or self._prop_wind_reverse_reverse is None ): # NOTICE: Value may be 0 or False - _LOGGER.info( + _LOGGER.error( 'invalid wind-reverse, %s', self.entity_id) continue self._attr_supported_features |= FanEntityFeature.DIRECTION