From 462afbe4da43cff62d5f787bad4f84f11eba6ad3 Mon Sep 17 00:00:00 2001 From: "karl.hudgell" Date: Thu, 28 Oct 2021 10:18:05 +0100 Subject: [PATCH] little bits --- mqtt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mqtt.py b/mqtt.py index 9d87461..04ed5df 100644 --- a/mqtt.py +++ b/mqtt.py @@ -1,5 +1,4 @@ import random -import time import json from paho.mqtt import client as mqtt_client @@ -40,10 +39,10 @@ def connect_mqtt() -> mqtt_client: def publish(client): - result = client.publish("ledLight/state", "on") + result = client.publish("ledLight/state", "ON") status = result[0] if status == 0: - print(f"Send `on` to topic `{topic}`") + print(f"Send `ON` to topic `{topic}`") else: print(f"Failed to send message to topic {topic}")