Fix bond fans without defined max_speed (#38382)
This commit is contained in:
1 parent
00a4bcff3d
commit
a00aa6740e
3 files changed
+22
-4
No files matched your search
@@ -75,7 +75,7 @@ class BondFan(BondEntity, FanEntity):
|
||||
return None
|
||||
|
||||
# map 1..max_speed Bond speed to 1..3 HA speed
|
||||
max_speed = self._device.props.get("max_speed", 3)
|
||||
max_speed = max(self._device.props.get("max_speed", 3), self._speed)
|
||||
ha_speed = math.ceil(self._speed * (len(self.speed_list) - 1) / max_speed)
|
||||
return self.speed_list[ha_speed]
|
||||
|
||||
|
||||
Reference in new issue
Block a user