Skip to content

Commit 0740c66

Browse files
Bram KragtenBram Kragten
authored andcommitted
set tempsetpoint
not tested
1 parent c31d6f4 commit 0740c66

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

lyric/lyric.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,28 @@ def indoorTemperature(self):
416416
if 'indoorTemperature' in self._lyric_api._device(self._locationId, self._deviceId):
417417
return self._lyric_api._device(self._locationId, self._deviceId)['indoorTemperature']
418418

419+
@temperatureSetpoint.setter
420+
def temperatureSetpoint(self, setpoint, mode=None):
421+
if mode is None:
422+
if setpoint > indoorTemperature:
423+
mode = 'Heat';
424+
else:
425+
mode = 'Cool';
426+
427+
if mode=='Cool':
428+
data = '{'
429+
'"mode": ' + mode + ','
430+
'"coolSetpoint": ' + setpoint + ','
431+
'}'
432+
433+
if mode=='Heat':
434+
data = '{'
435+
'"mode": ' + mode + ','
436+
'"heatSetpoint": ' + setpoint + ','
437+
'}'
438+
439+
self._set(self, 'devices/thermostats/' + self.deviceId, data, locationId:self._locationId):
440+
419441
@property
420442
def outdoorTemperature(self):
421443
if 'outdoorTemperature' in self._lyric_api._device(self._locationId, self._deviceId):

0 commit comments

Comments
 (0)