def __init__(self, i2c, device_address):
    '\n        Try to read a byte from an address,\n        if you get an OSError it means the device is not there\n        '
    while (not i2c.try_lock()):
        pass
    try:
        i2c.writeto(device_address, b'')
    except OSError:
        try:
            result = bytearray(1)
            i2c.readfrom_into(device_address, result)
        except OSError:
            raise ValueError(('No I2C device at address: %x' % device_address))
    finally:
        i2c.unlock()
    self.i2c = i2c
    self.device_address = device_address
Try to read a byte from an address,
if you get an OSError it means the device is not there
def __init__(self, i2c, device_address):
    '\n        Try to read a byte from an address,\n        if you get an OSError it means the device is not there\n        '
    while (not i2c.try_lock()):
        pass
    try:
        i2c.writeto(device_address, b)
    except OSError:
        try:
            result = bytearray(1)
            i2c.readfrom_into(device_address, result)
        except OSError:
            raise ValueError(('No I2C device at address: %x' % device_address))
    finally:
        i2c.unlock()
    self.i2c = i2c
    self.device_address = device_address