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 heating_cooling state to Hysen #722

Merged
merged 1 commit into from
Jan 22, 2023
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
7 changes: 5 additions & 2 deletions broadlink/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def get_full_status(self) -> dict:
data["power"] = payload[4] & 1
data["active"] = (payload[4] >> 4) & 1
data["temp_manual"] = (payload[4] >> 6) & 1
data["heating_cooling"] = (payload[4] >> 7) & 1
data["room_temp"] = payload[5] / 2.0
data["thermostat_temp"] = payload[6] / 2.0
data["auto_mode"] = payload[7] & 0xF
Expand Down Expand Up @@ -185,9 +186,11 @@ def set_temp(self, temp: float) -> None:

# Set device on(1) or off(0), does not deactivate Wifi connectivity.
# Remote lock disables control by buttons on thermostat.
def set_power(self, power: int = 1, remote_lock: int = 0) -> None:
# heating_cooling: heating(0) cooling(1)
def set_power(self, power: int = 1, remote_lock: int = 0, heating_cooling: int = 0) -> None:
"""Set the power state of the device."""
self.send_request([0x01, 0x06, 0x00, 0x00, remote_lock, power])
state = (heating_cooling << 7) + power
self.send_request([0x01, 0x06, 0x00, 0x00, remote_lock, state])

# set time on device
# n.b. day=1 is Monday, ..., day=7 is Sunday
Expand Down