Skip to content

Commit 9e92f9d

Browse files
committed
test(bme280): Add regression test for humidity at t_fine=76800.
1 parent 343dab9 commit 9e92f9d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/scenarios/bme280.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ tests:
231231
expect_true: true
232232
mode: [mock]
233233

234+
- name: "Humidity valid when t_fine equals 76800"
235+
action: script
236+
script: |
237+
# Regression: _compensate_humidity() must not return 0 when t_fine - 76800 == 0
238+
dev.t_fine = 76800
239+
raw_hum = 28680
240+
hum_q22 = dev._compensate_humidity(raw_hum)
241+
result = hum_q22 > 0
242+
expect_true: true
243+
mode: [mock]
244+
234245
- name: "t_fine updated after temperature read"
235246
action: script
236247
script: |

0 commit comments

Comments
 (0)