Skip to content

Commit 9c37a71

Browse files
committed
Always write the new mode to the sensor
In FORCE mode, the sensor changes back to SLEEP after completeing a single measurement, but we are not updating the mode internally. It's better to always write the mode to the sensor, and trust the caller not to change it needlessly.
1 parent f40fb2c commit 9c37a71

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

adafruit_bme280.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ def mode(self):
198198
def mode(self, value):
199199
if not value in _BME280_MODES:
200200
raise ValueError('Mode \'%s\' not supported' % (value))
201-
if self._mode == value:
202-
return
203201
self._mode = value
204202
self._write_ctrl_meas()
205203

0 commit comments

Comments
 (0)