diff --git a/octoprint_enclosure/getDHTTemp.py b/octoprint_enclosure/getDHTTemp.py index e898977..92960e5 100644 --- a/octoprint_enclosure/getDHTTemp.py +++ b/octoprint_enclosure/getDHTTemp.py @@ -1,7 +1,7 @@ import sys import time import adafruit_dht - +from microcontroller import Pin # Parse command line parameters. sensor_args = { @@ -16,7 +16,7 @@ else: sys.exit(1) -dht_dev = sensor(pin) +dht_dev = sensor(Pin(pin)) # DHT sensor read fails quite often, causing enclosure plugin to report value of 0. # If this happens, retry as suggested in the adafruit_dht docs. @@ -42,4 +42,4 @@ retry_count += 1 print('-1 | -1') -sys.exit(1) \ No newline at end of file +sys.exit(1)