Skip to content

Commit 478d5ae

Browse files
authored
Merge pull request #19 from adafruit/patch-fix
Linted
2 parents c11e8ad + c5a1fb5 commit 478d5ae

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

adafruit_dps310.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# Common imports; remove if unused or pylint will complain
3838
import math
3939
from time import sleep
40-
import adafruit_bus_device.i2c_device as i2c_device
40+
from adafruit_bus_device import i2c_device
4141
from adafruit_register.i2c_struct import UnaryStruct, ROUnaryStruct
4242
from adafruit_register.i2c_bit import RWBit, ROBit
4343
from adafruit_register.i2c_bits import RWBits, ROBits
@@ -344,11 +344,7 @@ def wait_temperature_ready(self):
344344
ie. ``Mode.ONE_TEMPERATURE``, ``Mode.CONT_TEMP`` or ``Mode.CONT_PRESTEMP``.
345345
See the `Mode` documentation for details.
346346
"""
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):
352348
raise RuntimeError(
353349
"Sensor mode is set to idle or pressure measurement,\
354350
can't wait for a temperature measurement"
@@ -369,11 +365,7 @@ def wait_pressure_ready(self):
369365
ie. ``Mode.ONE_PRESSURE``, ``Mode.CONT_PRESSURE`` or ``Mode.CONT_PRESTEMP``
370366
See the `Mode` documentation for details.
371367
"""
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):
377369
raise RuntimeError(
378370
"Sensor mode is set to idle or temperature measurement,\
379371
can't wait for a pressure measurement"

0 commit comments

Comments
 (0)