Skip to content

Commit 8a3a8b6

Browse files
committed
wsen-pads: Fix ruff errors.
1 parent 4799013 commit 8a3a8b6

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/wsen-pads/examples/altitude.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from wsen_pads import WSEN_PADS
44

55
SEA_LEVEL_PRESSURE = 1013.25 # depends on your location, you can adjust it for better altitude estimation
6-
# International Standard Atmosphere exponent: 1 / 5.255
6+
# International Standard Atmosphere exponent: 1 / 5.255
77
EXPONENT = 1.0 / 5.255
88

99
i2c = I2C(1)

lib/wsen-pads/examples/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
REG_CTRL_2,
99
REG_STATUS,
1010
REG_INT_SOURCE,
11-
CTRL1_BDU,
11+
CTRL1_BDU,
1212
CTRL2_IF_ADD_INC
1313
)
1414

lib/wsen-pads/wsen_pads/device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def __init__(self, i2c, address=WSEN_PADS_I2C_DEFAULT_ADDR):
5454
def _is_present(self):
5555
"""Return True if the device address is visible on the I2C bus."""
5656
try:
57-
self.i2c.readfrom(self.address, 1)
58-
return True
57+
self.i2c.readfrom(self.address, 1)
58+
return True
5959
except Exception:
6060
return False
6161

@@ -263,7 +263,7 @@ def read(self, low_noise=False):
263263
Returns:
264264
tuple: (pressure_hpa, temperature_c)
265265
"""
266-
if continuous_mode := (self._read_u8(REG_CTRL_1) & CTRL1_ODR_MASK) != 0:
266+
if (self._read_u8(REG_CTRL_1) & CTRL1_ODR_MASK) != 0:
267267
raise WSENPADSInvalidMode(
268268
"read() cannot be used in continuous mode. Please call power_down() first."
269269
)

0 commit comments

Comments
 (0)