Skip to content

Commit 343dab9

Browse files
committed
fix(bme280): Address Copilot review comments on PR 312.
1 parent 7b07e7e commit 343dab9

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

lib/bme280/bme280/device.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _wait_measurement(self, timeout_ms=100):
185185
# --------------------------------------------------
186186

187187
def _read_raw(self):
188-
"""Read raw ADC values for pressure, temperature, humidity (burst read).
188+
"""Read raw ADC values via burst read (0xF7-0xFE, 8 bytes).
189189
190190
Returns (raw_temp, raw_press, raw_hum) as 20-bit/20-bit/16-bit integers.
191191
"""
@@ -227,8 +227,6 @@ def _compensate_pressure(self, raw_press):
227227
def _compensate_humidity(self, raw_hum):
228228
"""Compute compensated humidity in Q22.10 fixed point."""
229229
h = self.t_fine - 76800
230-
if h == 0:
231-
return 0
232230
h = (
233231
(((raw_hum << 14) - (self.dig_H4 << 20) - (self.dig_H5 * h)) + 16384)
234232
>> 15

tests/scenarios/bme280.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ tests:
186186
expect_true: true
187187
mode: [mock]
188188

189-
- name: "temperature_ready delegates to data_ready"
189+
- name: "All ready methods delegate to data_ready"
190190
action: script
191191
script: |
192192
result = dev.temperature_ready() and dev.pressure_ready() and dev.humidity_ready()

0 commit comments

Comments
 (0)