Description
The wsen-hids examples contained full_test.py (482 lines of PASS/FAIL assertions) which was a test suite, not a usage example. The other two examples (continuous_mode.py, one_shot_mode.py) were OK.
Previous state
File
Type
Lines
continuous_mode.py
Practical example
OK — kept
one_shot_mode.py
Practical example
OK — kept
full_test.py
Test suite (PASS/FAIL)
482 — removed
What was done (PR #239 )
Removed full_test.py — replaced by tests/scenarios/wsen_hids.yaml for CI test coverage
Added 6 practical examples focused on real-world applications and hardware features
Updated README.md with a table listing all 8 examples
Final example set
Example
Description
Notes
one_shot_mode.py
One-shot measurement on demand
Existed before
continuous_mode.py
Continuous mode with periodic reads
Existed before
humidity_temperature.py
Single read (beginner-friendly first example)
New
comfort_monitor.py
Comfort indicator (Dry/Comfortable/Humid) every 2 s
New
data_logger.py
CSV logging to DAPLink flash + serial. Erasure opt-in via flag
New — reviewed: ERASE_FLASH_ON_START = False
dew_point.py
Dew point calculation using Magnus formula
New — reviewed: humidity clamped to avoid log(0)
heater_demo.py
Built-in heater demo: compare readings before/after
New
low_power_sampling.py
One-shot every 10 s with power_off() between reads
New — requires firmware >= v0.1.0 (#238 )
Review notes
data_logger.py: clear_flash() made opt-in instead of unconditional (destructive operation)
low_power_sampling.py: depends on wsen_hids: one-shot measurement timeout after power cycle #238 fix for power_off()/power_on() cycle
dew_point.py: max(humidity, 0.01) clamp to prevent log(0) domain error
All test cases from full_test.py were verified to be covered in tests/scenarios/wsen_hids.yaml
Reference
Driver code: lib/wsen-hids/wsen_hids/device.py
Key methods: temperature(), humidity(), set_continuous(), power_off(), enable_heater(), read_one_shot(), trigger_one_shot()
Checklist
Description
The
wsen-hidsexamples containedfull_test.py(482 lines of PASS/FAIL assertions) which was a test suite, not a usage example. The other two examples (continuous_mode.py,one_shot_mode.py) were OK.Previous state
continuous_mode.pyone_shot_mode.pyfull_test.pyWhat was done (PR #239)
full_test.py— replaced bytests/scenarios/wsen_hids.yamlfor CI test coverageFinal example set
one_shot_mode.pycontinuous_mode.pyhumidity_temperature.pycomfort_monitor.pydata_logger.pyERASE_FLASH_ON_START = Falsedew_point.pylog(0)heater_demo.pylow_power_sampling.pypower_off()between readsReview notes
data_logger.py:clear_flash()made opt-in instead of unconditional (destructive operation)low_power_sampling.py: depends on wsen_hids: one-shot measurement timeout after power cycle #238 fix forpower_off()/power_on()cycledew_point.py:max(humidity, 0.01)clamp to preventlog(0)domain errorfull_test.pywere verified to be covered intests/scenarios/wsen_hids.yamlReference
lib/wsen-hids/wsen_hids/device.pytemperature(),humidity(),set_continuous(),power_off(),enable_heater(),read_one_shot(),trigger_one_shot()Checklist
full_test.pyremoved from examplestests/scenarios/ruff checkpasses