scripts/wordclock.py

14 lines
432 B
Python
Executable File

#!/usr/bin/env python3
import sys
import paho.mqtt.client as mqtt
import wordclock_credentials as creds
client = mqtt.Client("wordclock.py")
client.username_pw_set(creds.USER, creds.PASSWORD)
client.connect(creds.MQTT_HOST, 1883, 60)
client.publish("wordclock/color/red", sys.argv[2], retain=True)
client.publish("wordclock/color/green", sys.argv[1], retain=True)
client.publish("wordclock/color/blue", sys.argv[3], retain=True)