Implement percentage step sizes for fans (#46512)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston 2021-02-18 21:05:09 -10:00 committed by GitHub
parent 5df46b60e8
commit f2b303d509
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 447 additions and 3 deletions

View file

@ -119,6 +119,11 @@ class EsphomeFan(EsphomeEntity, FanEntity):
ORDERED_NAMED_FAN_SPEEDS, self._state.speed
)
@property
def speed_count(self) -> Optional[int]:
"""Return the number of speeds the fan supports."""
return len(ORDERED_NAMED_FAN_SPEEDS)
@esphome_state_property
def oscillating(self) -> None:
"""Return the oscillation state."""