Updated GitIgnore

This commit is contained in:
2023-04-03 10:25:46 +02:00
parent e39b2a2753
commit 7b9f560da5
3 changed files with 31 additions and 4 deletions
+8 -3
View File
@@ -3,11 +3,16 @@ import random
import time
mqttBroker = "mqtt.eclipseprojects.io"
client = mqtt.Client("Temperature")
client.connect(mqttBroker)
client1 = mqtt.Client("Temperature")
client1.connect(mqttBroker)
while True:
randNumber = random.randint(0, 20)
client.publish("TEMPERATURE", randNumber)
client1.publish("TEMPERATURE", randNumber)
print("Published " + str(randNumber) + " to topic TEMPERATURE")
time.sleep(2)
randNumber = random.randint(0, 100)
client1.publish("HUMIDITY", randNumber)
print("Published " + str(randNumber) + " to topic HUMIDITY")
time.sleep(2)