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