Skip to content

Commit 04532d6

Browse files
committed
wsen-pads: Fix copilot errors
1 parent ff6f979 commit 04532d6

8 files changed

Lines changed: 7 additions & 16 deletions

File tree

lib/wsen-pads/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ sensor.reboot()
199199

200200
Examples are available in the `examples` directory.
201201

202-
```
203-
examples/
204-
example_basic.py
205-
example_oneshot.py
206-
test.py
207-
```
208-
209202
---
210203

211204
# Driver Structure
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
for _ in range(10):
1616
pressure_hpa, temperature_c = pads.read()
1717

18-
pressure_hpa = pads.pressure()
19-
temperature_c = pads.temperature()
20-
2118
print("P:", pressure_hpa, "hPa T:", temperature_c, "°C")
2219

2320
sleep(0.5)
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_i2c_scan(i2c):
4949
print_pass("WSEN-PADS address found")
5050
return True
5151
else:
52-
print_fail("WSEN-PADS address found")
52+
print_fail("WSEN-PADS address not found")
5353
return False
5454

5555

@@ -114,7 +114,7 @@ def test_reboot(sensor):
114114
print_header("5) Reboot")
115115
try:
116116
sensor.reboot()
117-
sleep(0.05)
117+
sleep(1)
118118
dump_registers(sensor)
119119

120120
if sensor.device_id() == 0xB3:

lib/wsen-pads/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
version="0.0.1",
44
)
55

6-
package("wsen-pads")
6+
package("wsen_pads")

lib/wsen-pads/wsen_pads/device.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ def _wait_boot(self, timeout_ms=20):
112112
while self._read_u8(REG_INT_SOURCE) & INT_SOURCE_BOOT_ON:
113113
if ticks_diff(ticks_ms(), start) > timeout_ms:
114114
raise WSENPADSTimeout("WSEN-PADS boot timeout")
115+
sleep_ms(1)
115116

116117
def _check_device(self):
117118
"""Raise an exception if the device ID does not match."""
118-
if self.device_id() != WSEN_PADS_DEVICE_ID:
119+
device_id = self.device_id()
120+
if device_id != WSEN_PADS_DEVICE_ID:
119121
raise WSENPADSInvalidDevice(
120-
"Invalid WSEN-PADS device ID: 0x{:02X}".format(self.device_id())
122+
"Invalid WSEN-PADS device ID: 0x{:02X}".format(device_id)
121123
)
122124

123125
def _configure_default(self):
@@ -300,7 +302,6 @@ def read_one_shot(self, low_noise=False):
300302
Returns:
301303
tuple: (pressure_hpa, temperature_c)
302304
"""
303-
self.trigger_one_shot(low_noise=low_noise)
304305
return self.read()
305306

306307
# ---------------------------------------------------------------------

0 commit comments

Comments
 (0)