little bits

This commit is contained in:
karl.hudgell 2021-10-28 10:18:05 +01:00
parent eda62774ec
commit 462afbe4da

View File

@ -1,5 +1,4 @@
import random import random
import time
import json import json
from paho.mqtt import client as mqtt_client from paho.mqtt import client as mqtt_client
@ -40,10 +39,10 @@ def connect_mqtt() -> mqtt_client:
def publish(client): def publish(client):
result = client.publish("ledLight/state", "on") result = client.publish("ledLight/state", "ON")
status = result[0] status = result[0]
if status == 0: if status == 0:
print(f"Send `on` to topic `{topic}`") print(f"Send `ON` to topic `{topic}`")
else: else:
print(f"Failed to send message to topic {topic}") print(f"Failed to send message to topic {topic}")