mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +02:00
Fix smaty fan typing (#46941)
This commit is contained in:
parent
f33618d33d
commit
08889a9819
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity
|
from homeassistant.components.fan import SUPPORT_SET_SPEED, FanEntity
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
@ -65,12 +64,12 @@ class SmartyFan(FanEntity):
|
|||||||
return bool(self._smarty_fan_speed)
|
return bool(self._smarty_fan_speed)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def speed_count(self) -> Optional[int]:
|
def speed_count(self) -> int:
|
||||||
"""Return the number of speeds the fan supports."""
|
"""Return the number of speeds the fan supports."""
|
||||||
return int_states_in_range(SPEED_RANGE)
|
return int_states_in_range(SPEED_RANGE)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def percentage(self) -> str:
|
def percentage(self) -> int:
|
||||||
"""Return speed percentage of the fan."""
|
"""Return speed percentage of the fan."""
|
||||||
if self._smarty_fan_speed == 0:
|
if self._smarty_fan_speed == 0:
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user