diff --git a/libdyson/dyson_pure_cool_link.py b/libdyson/dyson_pure_cool_link.py index ecf78e4..95a3bdf 100644 --- a/libdyson/dyson_pure_cool_link.py +++ b/libdyson/dyson_pure_cool_link.py @@ -7,6 +7,10 @@ class DysonPureCoolLink(DysonFanDevice): """Dyson Pure Cool Link device.""" + def __init__(self, serial: str, credential: str, device_type: str): + super().__init__(serial, credential, device_type) + self.preset_mode = "FAN" + @property def fan_mode(self) -> str: """Return the fan mode of the fan.""" @@ -20,7 +24,11 @@ def is_on(self) -> bool: @property def auto_mode(self) -> bool: """Return auto mode status.""" - return self.fan_mode == "AUTO" + if not self.is_on: + return self.preset_mode == "AUTO" + else: + self.preset_mode = self.fan_mode + return self.preset_mode == "AUTO" @property def oscillation(self) -> bool: @@ -49,7 +57,7 @@ def volatile_organic_compounds(self) -> int: def turn_on(self) -> None: """Turn on the device.""" - self._set_configuration(fmod="FAN") + self._set_configuration(fmod=self.preset_mode) def turn_off(self) -> None: """Turn off the device.""" @@ -60,10 +68,12 @@ def _set_speed(self, speed: int) -> None: def enable_auto_mode(self) -> None: """Turn on auto mode.""" + self.preset_mode = "AUTO" self._set_configuration(fmod="AUTO") def disable_auto_mode(self) -> None: """Turn off auto mode.""" + self.preset_mode = "FAN" self._set_configuration(fmod="FAN") def enable_oscillation(self) -> None: