Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
30 lines (24 sloc) 679 Bytes
import json
# sudo pip install request
import requests

# Construct the signal to send
signal = {
    'zoneId': 'KEY_Q',
    'color': '#FF0000',
    'effect': 'SET_COLOR',
    'pid': 'DK5QPID',
    'clientName': 'Python script',
    'message': 'Q App version 3 is available. Download it at',
    'name': 'New Q app version available'

signal_json = json.dumps(signal)

# sending the signal

res_signal = + '/api/1.0/signals', data=signal_json, headers=headers)

# checking the response
if res_signal.ok:
    print "OK"
    print res_signal.text
    print "Error: " + res_signal.text