Skip to content

Commit

Permalink
Fix percentage when turning off
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeSG committed Mar 31, 2021
1 parent 2cb7f63 commit 56ab350
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/philips_airpurifier/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,10 @@ def icon(self):
@property
def percentage(self) -> int:
"""Return the current percentage."""
percentage = ordered_list_item_to_percentage(SPEED_NAMES, self._fan_speed)
return percentage

if self._fan_speed != "0":
percentage = ordered_list_item_to_percentage(SPEED_NAMES, self._fan_speed)
return percentage

@property
def preset_modes(self) -> [str]:
Expand Down

0 comments on commit 56ab350

Please sign in to comment.