vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
397 stars 202 forks source link

Plugin Broken after updating Octopi to Python 3 #466

Open stirlsilver opened 2 years ago

stirlsilver commented 2 years ago

Hi All, I had everything working well with respect to this plugin, but decided that it was time do the jump to Python 3 by updating Octopi to 0.18.0.

Since the update the temperature sensor (SI7021) has stopped working. Looking at the OctoPrint log I see the following error: 2022-01-07 22:17:07,383 - octoprint.plugins.enclosure - WARNING - An exception of type KeyError occurred on log_error. Arguments: ('temp_sensor_i2cbus',) Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1002, in get_sensor_data temp, hum = self.read_si7021_temp(sensor['temp_sensor_address'], sensor['temp_sensor_i2cbus']) KeyError: 'temp_sensor_i2cbus' 2022-01-07 22:17:07,384 - octoprint.plugins.enclosure - WARNING - An exception of type TypeError occurred on log_error. Arguments: ('cannot unpack non-iterable NoneType object',) Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 811, in check_enclosure_temp temp, hum, airquality = self.get_sensor_data(sensor) TypeError: cannot unpack non-iterable NoneType object

Would anyone know how this can be resolved?