File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -116,17 +116,18 @@ def calibrate(self) -> bool:
116
116
try :
117
117
# Newer AHT20's may not succeed with old command, so wrapping in try/except
118
118
i2c .write (self ._buf , start = 0 , end = 3 )
119
- except Exception : # pylint: disable=broad-except
119
+ except ( RuntimeError , OSError ):
120
120
calibration_failed = True
121
121
122
122
if calibration_failed :
123
123
# try another calibration command for newer AHT20's
124
+ # print("Calibration failed, trying AH20 command")
124
125
time .sleep (0.01 )
125
126
self ._buf [0 ] = AHT20_CMD_CALIBRATE
126
127
with self .i2c_device as i2c :
127
128
try :
128
129
i2c .write (self ._buf , start = 0 , end = 3 )
129
- except Exception :
130
+ except ( RuntimeError , OSError ) :
130
131
pass
131
132
132
133
while self .status & AHTX0_STATUS_BUSY :
You can’t perform that action at this time.
0 commit comments