briandconnelly / pyfttt Goto Github PK
View Code? Open in Web Editor NEWPython tools for interacting with IFTTT Webhooks Channel
License: BSD 2-Clause "Simplified" License
Python tools for interacting with IFTTT Webhooks Channel
License: BSD 2-Clause "Simplified" License
If any value starts with "-" (e.g. "-52,7", "-a") pyfttt fails.
Se below:
Traceback (most recent call last):
File "/home/pi/Documents/kutahaz.py", line 101, in
temp, humi, temp_k])
File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pyfttt', '-k', '', '-e', '**', '19,5', '-52,7', '-a']' returned non-zero exit status 2
Line 27 in fed3d8e
I've been trying to get home assistant (which imports this module) to send json data to IFTTT and it's not working correctly. Looking at their docs to get anything usable besides the event name (I could be wrong), you need to send it a different way
https://help.ifttt.com/hc/en-us/articles/4405029291163-Parsing-JSON-body-with-filter-code
Basically
Note that the URL for the [Webhooks - Receive a web request with a JSON payload](https://ifttt.com/maker_webhooks/triggers/json_event) trigger is in a slightly different format than the regular IFTTT Webhook URL (https://maker.ifttt.com/trigger/{event}/with/key/{key} vs https://maker.ifttt.com/trigger/{event}/json/with/key/{key}).
If the URL of your web request does not include /json/ as above, the {{JsonPayload}} ingredient will be empty:
So it looks like this should have the /json/
path added if the intention is to be able to use any values
Line 25 in fed3d8e
Installing pyfttt while not having requests already pre-installed does not work.
› pip3 install pyfttt
Downloading/unpacking pyfttt
Downloading pyfttt-0.1.tar.gz
Running setup.py (path:/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/setup.py) egg_info for package pyfttt
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/setup.py", line 9, in <module>
import pyfttt
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/pyfttt/__init__.py", line 7, in <module>
from pyfttt.sending import *
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/pyfttt/sending.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/setup.py", line 9, in <module>
import pyfttt
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/pyfttt/__init__.py", line 7, in <module>
from pyfttt.sending import *
File "/Users/paulus/dev/temp/pyvenv-test/build/pyfttt/pyfttt/sending.py", line 3, in <module>
import requests
ImportError: No module named 'requests'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/paulus/dev/temp/pyvenv-test/build/pyfttt
Storing debug log for failure in /Users/paulus/.pip/pip.log
Steps to reproduce:
mkdir pyvenv-test
python3 pyvenv-test
cd pyvenv-test
# Replace next line on Windows with Scripts\activate.bat
source bin/activate
pip3 install pyfttt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.