Skip to content

Instantly share code, notes, and snippets.

@lmeulen
Last active May 30, 2021 08:45
Show Gist options
  • Save lmeulen/d5961d92ceb321d1f5e79b25f11ac7ef to your computer and use it in GitHub Desktop.
Save lmeulen/d5961d92ceb321d1f5e79b25f11ac7ef to your computer and use it in GitHub Desktop.
Screens_tahoma_package
import logging, requests
logger = logging.getLogger('home automation')
class Screens(object):
def __init__(self, ifttt_key):
self.ifttt_key = ifttt_key
def ifttt_call(self, triggername):
logger.debug('Firing screen trigger : ' + triggername)
requests.post("https://maker.ifttt.com/trigger/" + triggername + "/with/key/" +
self.ifttt_key, data={})
def close_all(self):
self.ifttt_call('screens_close_all')
def open_all(self):
self.ifttt_call('screens_open_all')
def open_by_name(self, name='all'):
self.ifttt_call('screens_open_' + name)
def close_by_name(self, name='all'):
self.ifttt_call('screens_close_' + name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment