Handle get_light exception
sighmon opened this issue · 0 comments
sighmon commented
And fix for all sensor getting
25.03.21 08:52:38 (+1030) main Traceback (most recent call last):
25.03.21 08:52:38 (+1030) main File "enviroplus_exporter.py", line 508, in <module>
25.03.21 08:52:38 (+1030) main get_light()
25.03.21 08:52:38 (+1030) main File "enviroplus_exporter.py", line 182, in get_light
25.03.21 08:52:38 (+1030) main prox = ltr559.get_proximity()
25.03.21 08:52:38 (+1030) main File "/usr/local/lib/python3.7/site-packages/ltr559/__init__.py", line 454, in get_proximity
25.03.21 08:52:38 (+1030) main self.update_sensor()
25.03.21 08:52:38 (+1030) main File "/usr/local/lib/python3.7/site-packages/ltr559/__init__.py", line 395, in update_sensor
25.03.21 08:52:38 (+1030) main als = self._ltr559.get('ALS_DATA')
25.03.21 08:52:38 (+1030) main File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 230, in get
25.03.21 08:52:38 (+1030) main self.read_register(register)
25.03.21 08:52:38 (+1030) main File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 183, in read_register
25.03.21 08:52:38 (+1030) main self.values[register.name] = self._i2c_read(register.address, register.bit_width)
25.03.21 08:52:38 (+1030) main File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 283, in _i2c_read
25.03.21 08:52:38 (+1030) main for x in self._i2c.read_i2c_block_data(self._i2c_address, register, bit_width // self._bit_width):
25.03.21 08:52:38 (+1030) main OSError: [Errno 121] Remote I/O error