Skip to content

Commit

Permalink
Fix incorrect comparison of speed "off" by identity instead of by val…
Browse files Browse the repository at this point in the history
…ue (#37738)
  • Loading branch information
prystupa authored Jul 11, 2020
1 parent 366354c commit 0fbdb47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/fan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def set_speed(self, speed: str) -> None:

async def async_set_speed(self, speed: str):
"""Set the speed of the fan."""
if speed is SPEED_OFF:
if speed == SPEED_OFF:
await self.async_turn_off()
else:
await self.hass.async_add_job(self.set_speed, speed)
Expand All @@ -128,7 +128,7 @@ def turn_on(self, speed: Optional[str] = None, **kwargs) -> None:
# pylint: disable=arguments-differ
async def async_turn_on(self, speed: Optional[str] = None, **kwargs):
"""Turn on the fan."""
if speed is SPEED_OFF:
if speed == SPEED_OFF:
await self.async_turn_off()
else:
await self.hass.async_add_job(ft.partial(self.turn_on, speed, **kwargs))
Expand Down

0 comments on commit 0fbdb47

Please sign in to comment.