When checking the chip ID in init() (to confirm whether the device is a BME680 or not), errors of type IOError are not caught, unlike the pimoroni/bme280-python library, where a try/except block is used to catch an IOError and re-raise as RuntimeError instead.
This arises, for example, when trying to initialise the device when it doesn't exist at the address. It's not show-stopper, but I thought it might be preferable to be consistent across the two libraries, so this PR adopts the convention used in bme280-python and raises a RuntimeError in this situation.
When checking the chip ID in
init()
(to confirm whether the device is a BME680 or not), errors of typeIOError
are not caught, unlike the pimoroni/bme280-python library, where atry/except
block is used to catch anIOError
and re-raise asRuntimeError
instead.This arises, for example, when trying to initialise the device when it doesn't exist at the address. It's not show-stopper, but I thought it might be preferable to be consistent across the two libraries, so this PR adopts the convention used in bme280-python and raises a
RuntimeError
in this situation.Tangentially relevant to issues #19, #23, #10