Separate fan speeds into percentages and presets modes (#45407)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: John Carr <john.carr@unrouted.co.uk>
This commit is contained in:
J. Nick Koston
2021-01-27 17:44:36 -06:00
committed by GitHub
parent 3f948e027a
commit 068d1b5eb8
36 changed files with 1607 additions and 112 deletions

View File

@@ -86,7 +86,14 @@ class SmartyFan(FanEntity):
self._speed = speed
self._state = True
def turn_on(self, speed=None, **kwargs):
#
# The fan entity model has changed to use percentages and preset_modes
# instead of speeds.
#
# Please review
# https://developers.home-assistant.io/docs/core/entity/fan/
#
def turn_on(self, speed=None, percentage=None, preset_mode=None, **kwargs):
"""Turn on the fan."""
_LOGGER.debug("Turning on fan. Speed is %s", speed)
if speed is None: