fix: wind-reverse format type

This commit is contained in:
LiShuzhen 2025-03-03 13:15:35 +08:00
parent 672e5b3f5d
commit df164868bf

View File

@ -172,7 +172,7 @@ class Fan(MIoTServiceEntity, FanEntity):
self._attr_supported_features |= FanEntityFeature.OSCILLATE self._attr_supported_features |= FanEntityFeature.OSCILLATE
self._prop_horizontal_swing = prop self._prop_horizontal_swing = prop
elif prop.name == 'wind-reverse': elif prop.name == 'wind-reverse':
if prop.format_ == 'bool': if prop.format_ == bool:
self._prop_wind_reverse_forward = False self._prop_wind_reverse_forward = False
self._prop_wind_reverse_reverse = True self._prop_wind_reverse_reverse = True
elif prop.value_list: elif prop.value_list:
@ -186,7 +186,7 @@ class Fan(MIoTServiceEntity, FanEntity):
or self._prop_wind_reverse_reverse is None or self._prop_wind_reverse_reverse is None
): ):
# NOTICE: Value may be 0 or False # NOTICE: Value may be 0 or False
_LOGGER.info( _LOGGER.error(
'invalid wind-reverse, %s', self.entity_id) 'invalid wind-reverse, %s', self.entity_id)
continue continue
self._attr_supported_features |= FanEntityFeature.DIRECTION self._attr_supported_features |= FanEntityFeature.DIRECTION