stfc-aeg / odin-lpdpower

Prototype of ODIN framework
0 stars 0 forks source link

Remove dependency on Adafruit_I2C module #10

Closed timcnicholls closed 7 years ago

timcnicholls commented 8 years ago

Current I2CDevice class is a wrapper (with pre-access callbacks) to the Adafruit_I2C module. This is a simple wrapper of the underlying smbus library, but handles errors badly and produces stdout error messages for access failures.

It will be trivial to remove Adafruit_I2C by accessing the underlying smbus library calls directly and provide the appropriate use of exceptions and/or a default logger.

The pre-access callback could also be simplified to use a decorator.