forked from robintw/pywavethermo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWaveThermo.py
39 lines (31 loc) · 1.4 KB
/
WaveThermo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from SetBot import SetBot
from StatusBot import StatusBot
class WaveThermo:
def __init__(self, serial_number, access_code, password):
self.status = StatusBot(serial_number=serial_number,
access_code=access_code,
password=password)
self.setter = SetBot(serial_number=serial_number,
access_code=access_code,
password=password)
def set_mode(self, mode):
"""
Set the control mode of the thermostat
Parameters
----------
mode : str
Control mode, either "manual" or "clock"
"""
self.setter.post_message("/heatingCircuits/hc1/usermode", mode)
def set_temperature(self, temperature):
self.status.update()
if self.status.program_mode == 'manual':
self.setter.post_message("/heatingCircuits/hc1/temperatureRoomManual", temperature)
else:
self.setter.post_message("/heatingCircuits/hc1/manualTempOverride/temperature", temperature)
self.setter.post_message("/heatingCircuits/hc1/manualTempOverride/status", 'on')
def override(self, b):
if b:
self.setter.post_message("/heatingCircuits/hc1/manualTempOverride/status", 'on')
else:
self.setter.post_message("/heatingCircuits/hc1/manualTempOverride/status", 'off')