mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-06 17:51:36 +00:00
Initial Configuration Push
This commit is contained in:
13
deps/pyfttt/sending.py
vendored
Normal file
13
deps/pyfttt/sending.py
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""Handle sending API requests to the IFTTT Maker Channel"""
|
||||
|
||||
import requests
|
||||
|
||||
def send_event(api_key, event, value1=None, value2=None, value3=None):
|
||||
"""Send an event to the IFTTT maker channel"""
|
||||
url = "https://maker.ifttt.com/trigger/{e}/with/key/{k}/".format(e=event,
|
||||
k=api_key)
|
||||
payload = {'value1': value1, 'value2': value2, 'value3': value3}
|
||||
return requests.post(url, data=payload)
|
||||
|
||||
Reference in New Issue
Block a user