Updated GitIgnore
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user