Last active
May 30, 2021 08:45
-
-
Save lmeulen/d5961d92ceb321d1f5e79b25f11ac7ef to your computer and use it in GitHub Desktop.
Screens_tahoma_package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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