37
37
# Common imports; remove if unused or pylint will complain
38
38
import math
39
39
from time import sleep
40
- import adafruit_bus_device . i2c_device as i2c_device
40
+ from adafruit_bus_device import i2c_device
41
41
from adafruit_register .i2c_struct import UnaryStruct , ROUnaryStruct
42
42
from adafruit_register .i2c_bit import RWBit , ROBit
43
43
from adafruit_register .i2c_bits import RWBits , ROBits
@@ -344,11 +344,7 @@ def wait_temperature_ready(self):
344
344
ie. ``Mode.ONE_TEMPERATURE``, ``Mode.CONT_TEMP`` or ``Mode.CONT_PRESTEMP``.
345
345
See the `Mode` documentation for details.
346
346
"""
347
- if (
348
- self ._mode_bits == Mode .IDLE
349
- or self ._mode_bits == Mode .ONE_PRESSURE
350
- or self ._mode_bits == Mode .CONT_PRESSURE
351
- ):
347
+ if self ._mode_bits in (Mode .IDLE , Mode .ONE_PRESSURE , Mode .CONT_PRESSURE ):
352
348
raise RuntimeError (
353
349
"Sensor mode is set to idle or pressure measurement,\
354
350
can't wait for a temperature measurement"
@@ -369,11 +365,7 @@ def wait_pressure_ready(self):
369
365
ie. ``Mode.ONE_PRESSURE``, ``Mode.CONT_PRESSURE`` or ``Mode.CONT_PRESTEMP``
370
366
See the `Mode` documentation for details.
371
367
"""
372
- if (
373
- self ._mode_bits == Mode .IDLE
374
- or self ._mode_bits == Mode .ONE_TEMPERATURE
375
- or self ._mode_bits == Mode .CONT_TEMP
376
- ):
368
+ if self ._mode_bits in (Mode .IDLE , Mode .ONE_TEMPERATURE , Mode .CONT_TEMP ):
377
369
raise RuntimeError (
378
370
"Sensor mode is set to idle or temperature measurement,\
379
371
can't wait for a pressure measurement"
0 commit comments