1
mirror of https://github.com/home-assistant/core synced 2024-08-31 05:57:13 +02:00

Fix smaty fan typing (#46941)

This commit is contained in:
J. Nick Koston 2021-02-22 20:14:39 -10:00 committed by GitHub
parent f33618d33d
commit 08889a9819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@
import logging
import math
from typing import Optional
from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity
from homeassistant.core import callback
@ -65,12 +64,12 @@ class SmartyFan(FanEntity):
return bool(self._smarty_fan_speed)
@property
def speed_count(self) -> Optional[int]:
def speed_count(self) -> int:
"""Return the number of speeds the fan supports."""
return int_states_in_range(SPEED_RANGE)
@property
def percentage(self) -> str:
def percentage(self) -> int:
"""Return speed percentage of the fan."""
if self._smarty_fan_speed == 0:
return 0