kplindegaard / smbus2

A drop-in replacement for smbus-cffi/smbus-python in pure Python
MIT License
243 stars 68 forks source link

Support named buses #17

Closed jabdoa2 closed 5 years ago

jabdoa2 commented 6 years ago

It would be nice to support named devices for USB-I2C adapters such as tiny-i2c-usb because their bus number will not be consistent between restarts. However, we can create symlinks using udev. Currently, I just symlink to /dev/i2c-my-bus1 and use "my-bus1" as bus id in smbus2. Works as a hack but it is probably not intended this way.

kplindegaard commented 5 years ago

Above mentioned PR lets you provide the full path, i.e. you can choose between bus number (int) and a string containing a full path.

jabdoa2 commented 5 years ago

Awesome thanks!