Skip to content

Commit

Permalink
Don't show fan speed percentage when preset is active
Browse files Browse the repository at this point in the history
  • Loading branch information
emlove authored Jan 14, 2025
1 parent e66cd51 commit 80290fd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions custom_components/ha_blueair/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ def is_on(self) -> int:
@property
def percentage(self) -> int:
"""Return the current speed percentage."""
return int(round(self.coordinator.fan_speed * 33.33, 0))
if self.preset_mode is None:
return int(round(self.coordinator.fan_speed * 33.33, 0))
else:
return None

async def async_set_percentage(self, percentage: int) -> None:
"""Sets fan speed percentage."""
Expand Down Expand Up @@ -140,7 +143,10 @@ def is_on(self) -> int:
@property
def percentage(self) -> int:
"""Return the current speed percentage."""
return int((self.coordinator.fan_speed * 100) // self.coordinator.speed_count)
if self.preset_mode is None:
return int((self.coordinator.fan_speed * 100) // self.coordinator.speed_count)
else:
return None

async def async_set_percentage(self, percentage: int) -> None:
if self.coordinator.fan_auto_mode is True:
Expand Down

0 comments on commit 80290fd

Please sign in to comment.