Skip to content

Commit

Permalink
Add set_speed to smarty fan (home-assistant#32255)
Browse files Browse the repository at this point in the history
  • Loading branch information
z0mbieprocess authored Mar 4, 2020
1 parent 4f61969 commit f62322c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions homeassistant/components/smarty/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ def speed(self) -> str:
"""Return speed of the fan."""
return self._speed

def set_speed(self, speed: str) -> None:
"""Set the speed of the fan."""
_LOGGER.debug("Set the fan speed to %s", speed)
if speed == SPEED_OFF:
self.turn_off()
else:
self._smarty.set_fan_speed(SPEED_TO_MODE.get(speed))
self._speed = speed
self._state = True

def turn_on(self, speed=None, **kwargs):
"""Turn on the fan."""
_LOGGER.debug("Turning on fan. Speed is %s", speed)
Expand Down

0 comments on commit f62322c

Please sign in to comment.