Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions adafruit_si7021.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ def __init__(self, i2c_bus, address=0x40):
i2c.write(data, stop=False)
i2c.readinto(data)
value = data[0]
except OSError as error:
if error.args[0] not in ('I2C bus error', 19): # errno 19 ENODEV
raise
except OSError:
pass
else:
break
if value != _USER1_VAL:
Expand All @@ -96,9 +95,8 @@ def _data(self):
try:
with self.i2c_device as i2c:
i2c.readinto(data)
except OSError as error:
if error.args[0] not in ('I2C bus error', 19): # errno 19 ENODEV
raise
except OSError:
pass
else:
if data[0] != 0xff: # Check if read succeeded.
break
Expand Down