Skip to content

Commit ec5b677

Browse files
committed
Update
1 parent 95352b0 commit ec5b677

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

lyric/__init__.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ class Thermostat(lyricDevice):
413413
# scheduleType.scheduleType String Currently selected schedule type. Would follow the values in scheduleCapabilities.availableScheduleTypes.
414414
# scheduleType.scheduleSubType String Currently selected schedule subtype.
415415

416-
def updateThermostat(self, mode=None, heatSetpoint=None, coolSetpoint=None, AutoChangeover=None, thermostatSetpointStatus=None):
416+
def updateThermostat(self, mode=None, heatSetpoint=None, coolSetpoint=None, AutoChangeover=None, thermostatSetpointStatus=None, nextPeriodTime=None):
417417
if mode is None:
418418
mode = self.operationMode
419419
if heatSetpoint is None:
@@ -439,13 +439,19 @@ def updateThermostat(self, mode=None, heatSetpoint=None, coolSetpoint=None, Auto
439439
data['thermostatSetpointStatus'] = thermostatSetpointStatus
440440
if 'AutoChangeover' in self.changeableValues:
441441
data['AutoChangeover'] = AutoChangeover
442+
if nextPeriodTime is not None:
443+
data['nextPeriodTime'] = nextPeriodTime
442444

443445
self._set('devices/thermostats/' + self._deviceId, data=data)
444446

445447
@property
446448
def away(self):
447449
if self._lyric_api._location(self._locationId)['geoFenceEnabled']:
448450
return (self._lyric_api._location(self._locationId)['geoFences'][0]['geoOccupancy']['withinFence'] == 0)
451+
452+
@property
453+
def vacationHold(self):
454+
return self._lyric_api._device(self._locationId, self._deviceId)['vacationHold']['enabled']
449455

450456
@property
451457
def where(self):
@@ -477,6 +483,11 @@ def thermostatSetpointStatus(self):
477483
def thermostatSetpointStatus(self, thermostatSetpointStatus):
478484
self.updateThermostat(thermostatSetpointStatus=thermostatSetpointStatus)
479485

486+
def thermostatSetpointHoldUntil(self, nextPeriodTime, heatSetpoint=None, coolSetpoint=None):
487+
if (nextPeriodTime is None):
488+
raise ValueError('nextPeriodTime is required')
489+
self.updateThermostat(heatSetpoint=heatSetpoint, coolSetpoint=coolSetpoint, thermostatSetpointStatus='HoldUntil', nextPeriodTime=nextPeriodTime)
490+
480491
@property
481492
def nextPeriodTime(self):
482493
if 'nextPeriodTime' in self.changeableValues:
@@ -627,6 +638,11 @@ def settings(self):
627638
if 'settings' in self._lyric_api._device(self._locationId, self._deviceId):
628639
return self._lyric_api._device(self._locationId, self._deviceId)['settings']
629640

641+
@property
642+
def fanMode(self):
643+
if ('settings' in self._lyric_api._device(self._locationId, self._deviceId)) & ('fan' in self.settings):
644+
return self.settings["fan"]["changeableValues"]["mode"]
645+
630646
@property
631647
def macID(self):
632648
if 'macID' in self._lyric_api._device(self._locationId, self._deviceId):
@@ -675,7 +691,12 @@ def scheduleCapabilities(self):
675691
@property
676692
def scheduleType(self):
677693
if 'scheduleType' in self._lyric_api._device(self._locationId, self._deviceId):
678-
return self._lyric_api._device(self._locationId, self._deviceId)['scheduleType']
694+
return self._lyric_api._device(self._locationId, self._deviceId)['scheduleType']['scheduleType']
695+
696+
@property
697+
def scheduleSubType(self):
698+
if 'scheduleType' in self._lyric_api._device(self._locationId, self._deviceId):
699+
return self._lyric_api._device(self._locationId, self._deviceId)['scheduleType']['scheduleSubType']
679700

680701
# #changeableValues Object List of values/settings that can be changed on the thermostat. Used in POST requests.
681702
# changeableValues.mode String Current running mode. Will match values in allowedModes.

0 commit comments

Comments
 (0)