From 5099305dde9fc0d873518ab3e7334f0701446388 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sun, 17 Feb 2019 21:08:12 +0000 Subject: =?UTF-8?q?convert=20to=20string=C2=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fruitfly.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fruitfly.py') diff --git a/fruitfly.py b/fruitfly.py index 9542d75..684d30f 100644 --- a/fruitfly.py +++ b/fruitfly.py @@ -19,9 +19,9 @@ client.loop_start() while True: humidity, temperature = Adafruit_DHT.read_retry(sensor_type, sensor_pin) - print(client_id+"/temperature: "+ temperature) - print(client_id+"/humidity: "+ humidity) - client.publish(client_id+"/temperature", temperature) - client.publish(client_id+"/humidity", humidity) + print(client_id+"/temperature: "+ str(temperature)) + print(client_id+"/humidity: "+ str(humidity)) + client.publish(client_id+"/temperature", str(temperature)) + client.publish(client_id+"/humidity", str(humidity)) time.sleep(2) -- cgit v1.2.3