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.27.tar.gz
(17.5 kB
view hashes)
Built Distribution
Close
Hashes for triggercmd-0.0.27-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68accd66043684ad4fc4902a40d4582d922895f675485292ee6cdd69ef5a38c4 |
|
MD5 | 83d1331b281a585b04b48a9fe7384c36 |
|
BLAKE2b-256 | 4d4048a59e6cbb13d153b414bfd2b3cc1844e14b341b6c15025b01661dcc6d2f |