From 80290fd72899f2a3d81c5615e6461c10230140fc Mon Sep 17 00:00:00 2001 From: Emily Love Watson Date: Tue, 14 Jan 2025 13:33:41 -0600 Subject: [PATCH] Don't show fan speed percentage when preset is active --- custom_components/ha_blueair/fan.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/custom_components/ha_blueair/fan.py b/custom_components/ha_blueair/fan.py index 0c174dd..b2373d5 100644 --- a/custom_components/ha_blueair/fan.py +++ b/custom_components/ha_blueair/fan.py @@ -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.""" @@ -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: