Fixed getValues arguments
This commit is contained in:
@@ -47,7 +47,7 @@ def connect_mqtt():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getValues():
|
def getValues(sensor):
|
||||||
try:
|
try:
|
||||||
temp = sensor.temperature
|
temp = sensor.temperature
|
||||||
humidity = sensor.humidity
|
humidity = sensor.humidity
|
||||||
@@ -96,8 +96,8 @@ def run():
|
|||||||
client = connect_mqtt()
|
client = connect_mqtt()
|
||||||
client.loop_start()
|
client.loop_start()
|
||||||
while True:
|
while True:
|
||||||
temp = getValues()
|
temp = getValues(sensor)
|
||||||
humidity = getValues()
|
humidity = getValues(sensor)
|
||||||
publish(client, temp, humidity)
|
publish(client, temp, humidity)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user