Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add t_sleep control #128

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions aircon/aircon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .error import Error
from .properties import (AcProperties, AirFlow, AirFlowState, Economy, FanSpeed, FastColdHeat,
FglProperties, FglBProperties, HumidifierProperties, Properties, Power,
AcWorkMode, Quiet, TemperatureUnit)
AcWorkMode, Quiet, TemperatureUnit, SleepMode)


@dataclass(order=True)
Expand Down Expand Up @@ -165,7 +165,7 @@ def queue_command(self, name: str, value) -> None:
data_value = data_type(value)

# If device has set t_control_value it is being controlled by this field.
if name != 't_control_value' and self.get_property('t_control_value'):
if name != 't_control_value' and self.get_property('t_control_value') and name != 't_sleep':
self._convert_to_control_value(name, data_value)
return

Expand Down Expand Up @@ -315,6 +315,12 @@ def get_temperature(self) -> int:
else:
return self.get_property('t_temp')

def set_sleep(self, setting: SleepMode) -> None:
self.queue_command('t_control_value', setting)

def get_sleep(self) -> SleepMode:
self.get_property('t_sleep')

def set_work_mode(self, setting: AcWorkMode) -> None:
control = self.get_property('t_control_value')
if (control):
Expand Down