sighmon/enviroplus_exporter

Handle get_light OSError

sighmon opened this issue · 0 comments

  • Handle get_light() OSError

Errors

28.05.21 10:30:14 (+0930)  main  Traceback (most recent call last):
28.05.21 10:30:14 (+0930)  main    File "enviroplus_exporter.py", line 508, in <module>
28.05.21 10:30:14 (+0930)  main      get_light()
28.05.21 10:30:14 (+0930)  main    File "enviroplus_exporter.py", line 181, in get_light
28.05.21 10:30:14 (+0930)  main      lux = ltr559.get_lux()
28.05.21 10:30:14 (+0930)  main    File "/usr/local/lib/python3.7/site-packages/ltr559/__init__.py", line 443, in get_lux
28.05.21 10:30:14 (+0930)  main      self.update_sensor()
28.05.21 10:30:14 (+0930)  main    File "/usr/local/lib/python3.7/site-packages/ltr559/__init__.py", line 395, in update_sensor
28.05.21 10:30:14 (+0930)  main      als = self._ltr559.get('ALS_DATA')
28.05.21 10:30:14 (+0930)  main    File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 230, in get
28.05.21 10:30:14 (+0930)  main      self.read_register(register)
28.05.21 10:30:14 (+0930)  main    File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 183, in read_register
28.05.21 10:30:14 (+0930)  main      self.values[register.name] = self._i2c_read(register.address, register.bit_width)
28.05.21 10:30:14 (+0930)  main    File "/usr/local/lib/python3.7/site-packages/i2cdevice/__init__.py", line 283, in _i2c_read
28.05.21 10:30:14 (+0930)  main      for x in self._i2c.read_i2c_block_data(self._i2c_address, register, bit_width // self._bit_width):
28.05.21 10:30:14 (+0930)  main  OSError: [Errno 121] Remote I/O error