From e545f8f224ca08f14369003ff8363a81ce4f47ac Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 23 Jun 2023 11:58:35 -0700 Subject: [PATCH] mask feature set check --- adafruit_sgp40/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_sgp40/__init__.py b/adafruit_sgp40/__init__.py index 314df0c..058e9cc 100644 --- a/adafruit_sgp40/__init__.py +++ b/adafruit_sgp40/__init__.py @@ -137,7 +137,7 @@ def initialize(self) -> None: self._command_buffer[0] = 0x20 self._command_buffer[1] = 0x2F featureset = self._read_word_from_command() - if featureset[0] != 0x3220: + if featureset[0] & 0xFF00 != 0x3200: raise RuntimeError(f"Feature set does not match: {featureset[0]:#x}") # Self Test