Skip to content
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
18 changes: 18 additions & 0 deletions pyecobee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,24 @@ def set_climate_hold(self, index, climate, hold_type="nextTransition"):
" climate hold. Refreshing tokens...")
self.refresh_tokens()

def delete_vacation(self, index, vacation):
''' Delete the vacation with name vacation '''
url = 'https://api.ecobee.com/1/thermostat'
header = {'Content-Type': 'application/json;charset=UTF-8',
'Authorization': 'Bearer ' + self.access_token}
params = {'format': 'json'}
body = ('{"functions":[{"type":"deleteVacation","params":{"name":"'
+ vacation + '"}}],'
'"selection":{"selectionType":"registered","selectionMatch":"'
'"}}')
request = requests.post(url, headers=header, params=params, data=body)
if request.status_code == requests.codes.ok:
return request
else:
print("Error connecting to Ecobee while attempting to delete"
" a vacation. Refreshing tokens...")
self.refresh_tokens()

def resume_program(self, index, resume_all="false"):
''' Resume currently scheduled program '''
url = 'https://api.ecobee.com/1/thermostat'
Expand Down