mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-14 21:40:42 +08:00
fix: fan level property
This commit is contained in:
parent
03d2223a4a
commit
cce3913587
@ -135,7 +135,13 @@ class Fan(MIoTServiceEntity, FanEntity):
|
||||
)/self._speed_step+1
|
||||
self._attr_supported_features |= FanEntityFeature.SET_SPEED
|
||||
self._prop_fan_level = prop
|
||||
elif isinstance(prop.value_list, list) and prop.value_list:
|
||||
elif (
|
||||
self._prop_fan_level is None
|
||||
# Fan level with value-range is prior to fan level with value-list
|
||||
# when a fan has both fan level properties.
|
||||
and isinstance(prop.value_list, list)
|
||||
and prop.value_list
|
||||
):
|
||||
# Fan level with value-list
|
||||
self._speed_name_map = {item['value']: item['description']
|
||||
for item in prop.value_list}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user