Hi,
I've noticed that this library is using SMBus2.
I've already a couple sensor connected to I2C, which are using SMBus library and moreover SMBus object is a Singleton (see below snippet).
import atexit
from smbus import SMBus
from singleton.singleton import Singleton
from .const import PATH_TO_FILE_WITH_MODEL_VERSION, RASPBERRY_PI_MODEL_1
class SMBusWrapper(metaclass=Singleton):
def __init__(self):
self._smbus = SMBus(define_smbus_number())
atexit.register(self.close_smbus)
@property
def smbus(self):
return self._smbus
@smbus.setter
def smbus(self, value):
self._smbus = value
def close_smbus(self):
self._smbus.close()
Do you maybe have this library version, which is using SMBus and not SMBus2?
I would like to pass an globally created SMBus object to it.
I'm a little worried that if the vl53lx1object opens and closes /dev/i2c-X on its own, there will be some problems with the other sensors.
Hi, I've noticed that this library is using SMBus2.
I've already a couple sensor connected to I2C, which are using SMBus library and moreover SMBus object is a Singleton (see below snippet).
Do you maybe have this library version, which is using SMBus and not SMBus2? I would like to pass an globally created SMBus object to it. I'm a little worried that if the vl53lx1object opens and closes
/dev/i2c-X
on its own, there will be some problems with the other sensors.