diff --git a/adafruit_sgp30.py b/adafruit_sgp30.py index e031a5c..f32fc4a 100755 --- a/adafruit_sgp30.py +++ b/adafruit_sgp30.py @@ -51,7 +51,7 @@ # pylint: disable=bad-whitespace _SGP30_DEFAULT_I2C_ADDR = const(0x58) -_SGP30_FEATURESET = const(0x0020) +_SGP30_FEATURESETS = (0x0020, 0x0022) _SGP30_CRC8_POLYNOMIAL = const(0x31) _SGP30_CRC8_INIT = const(0xFF) @@ -71,7 +71,7 @@ def __init__(self, i2c, address=_SGP30_DEFAULT_I2C_ADDR): self.serial = self._i2c_read_words_from_cmd([0x36, 0x82], 0.01, 3) # get featureset featureset = self._i2c_read_words_from_cmd([0x20, 0x2f], 0.01, 1) - if featureset[0] != _SGP30_FEATURESET: + if featureset[0] not in _SGP30_FEATURESETS: raise RuntimeError('SGP30 Not detected') self.iaq_init()