Handle clamped fan maxValue in homekit_controller (#51088)
This commit is contained in:
parent
3a6a1a4d6b
commit
deb9135707
3 changed files with 307 additions and 1 deletions
|
@ -84,7 +84,8 @@ class BaseHomeKitFan(HomeKitEntity, FanEntity):
|
|||
def speed_count(self):
|
||||
"""Speed count for the fan."""
|
||||
return round(
|
||||
100 / max(1, self.service[CharacteristicsTypes.ROTATION_SPEED].minStep or 0)
|
||||
min(self.service[CharacteristicsTypes.ROTATION_SPEED].maxValue or 100, 100)
|
||||
/ max(1, self.service[CharacteristicsTypes.ROTATION_SPEED].minStep or 0)
|
||||
)
|
||||
|
||||
async def async_set_direction(self, direction):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue