Skip to content

Commit

Permalink
Favour readability over performance for SOF check
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Aug 17, 2020
1 parent ae2a64b commit 78a5e14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adafruit_pm25/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def read(self):
# print([hex(i) for i in self._buffer])

# check packet header
if (self._buffer[0] != 0x42) or (self._buffer[1] != 0x4D):
if not self._buffer[0:2] == b'BM':
raise RuntimeError("Invalid PM2.5 header")

# check frame length
Expand Down

0 comments on commit 78a5e14

Please sign in to comment.