Skip to content

Commit a758570

Browse files
authored
Merge pull request #37 from hudcap/master
Add more Ecobee functions
2 parents 4cb9bc2 + f3e0ebd commit a758570

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

pyecobee/__init__.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,52 @@ def set_humidity(self, index, humidity):
316316

317317
log_msg_action = "set humidity level"
318318
return self.make_request(body, log_msg_action)
319+
320+
def set_mic_mode(self, index, mic_enabled):
321+
'''Enable/disable Alexa mic (only for Ecobee 4)
322+
Values: True, False
323+
'''
324+
325+
body = {
326+
'selection': {
327+
'selectionType': 'thermostats',
328+
'selectionMatch': self.thermostats[index]['identifier']},
329+
'thermostat': {
330+
'audio': {
331+
'microphoneEnabled': mic_enabled}}}
332+
333+
log_msg_action = 'set mic mode'
334+
return self.make_request(body, log_msg_action)
335+
336+
def set_occupancy_modes(self, index, auto_away=None, follow_me=None):
337+
'''Enable/disable Smart Home/Away and Follow Me modes
338+
Values: True, False
339+
'''
340+
341+
body = {
342+
'selection': {
343+
'selectionType': 'thermostats',
344+
'selectionMatch': self.thermostats[index]['identifier']},
345+
'thermostat': {
346+
'settings': {
347+
'autoAway': auto_away,
348+
'followMeComfort': follow_me}}}
349+
350+
log_msg_action = 'set occupancy modes'
351+
return self.make_request(body, log_msg_action)
352+
353+
def set_dst_mode(self, index, dst):
354+
'''Enable/disable daylight savings
355+
Values: True, False
356+
'''
357+
358+
body = {
359+
'selection': {
360+
'selectionType': 'thermostats',
361+
'selectionMatch': self.thermostats[index]['identifier']},
362+
'thermostat': {
363+
'location': {
364+
'isDaylightSaving': dst}}}
365+
366+
log_msg_action = 'set dst mode'
367+
return self.make_request(body, log_msg_action)

0 commit comments

Comments
 (0)