Python agent for TRIGGERcmd cloud service.
Project description
TRIGGERcmd Python Package
For the full TRIGGERcmd agent, visit https://triggercmd.com.
Use this package to listen for triggers sent to a computer in your TRIGGERcmd account.
Send triggers with Amazon Alexa, Google Assistant, IFTTT, Zapier, Smart Things, etc. See this page for more ways.
Usage:
import json
from triggercmd import agent
computer_id = (your triggercmd computer id)
token = (your triggercmd token)
def my_function(msg):
print(msg)
message = json.loads(msg)
print("Received this trigger:", message['trigger'], "and these parameters:", message['params'])
agent.connect(computer_id, token, my_function)
Example output:
Connected
{"trigger":"Notepad","id":"13123391234567891acbf124","params":"on"}
Received this trigger: Notepad and these parameters: on
{"trigger":"Calculator","id":"13123391234567891acbf123","params":"on"}
Received this trigger: Calculator and these parameters: on
{"trigger":"Calculator","id":"13123391234567891acbf123","params":"off"}
Received this trigger: Calculator and these parameters: off
Based on this project:
https://github.com/gilsdav/python_sails_websocket_client/tree/master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
triggercmd-0.0.20.tar.gz
(15.9 kB
view hashes)
Built Distribution
Close
Hashes for triggercmd-0.0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f38ffe4a32082d4faf3069017b2c2d5cf9f0aebe56104ee571ddd24ce57f3b1 |
|
MD5 | d2923b20813f28e6c22cedc0a4563472 |
|
BLAKE2b-256 | 50f0f69230437b1553cacc83bb971f182b72a5097a652238d01f5205be23e4a8 |