Skip to content

fix: Correct broken method calls in lis2mdl and wsen-pads examples.#216

Merged
nedseb merged 1 commit intomainfrom
fix/broken-examples
Mar 23, 2026
Merged

fix: Correct broken method calls in lis2mdl and wsen-pads examples.#216
nedseb merged 1 commit intomainfrom
fix/broken-examples

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 23, 2026

Closes #214

Summary

Fix 2 examples that call methods not existing in their drivers, detected by the example validation test suite (#213).

Changes

File Bug Fix
lib/lis2mdl/examples/magnet_test.py Calls mag.read_reg() (28 occurrences) Replaced with mag._read_reg() (actual private method)
lib/wsen-pads/examples/test.py Calls sensor._read_u8() (5 occurrences) Replaced with sensor._read_reg() (actual private method)

Verification

python3 -m pytest tests/test_examples.py — 191 passed, 17 skipped, 0 failed

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@nedseb nedseb requested a review from Copilot March 23, 2026 07:59
@nedseb nedseb added the bug Something isn't working label Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two example scripts that were calling non-existent driver methods, aligning them with the actual low-level register-read helpers implemented by each driver (as detected by the example validation tests added in #213).

Changes:

  • Update lib/lis2mdl/examples/magnet_test.py to use dev._read_reg() instead of the non-existent dev.read_reg().
  • Update lib/wsen-pads/examples/test.py to use sensor._read_reg() instead of the non-existent sensor._read_u8().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/lis2mdl/examples/magnet_test.py Replaces invalid register-read calls with the driver’s existing _read_reg() helper so the example runs and passes validation.
lib/wsen-pads/examples/test.py Switches to _read_reg() for register dumps/default checks to match the WSEN-PADS driver API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nedseb nedseb merged commit f26a055 into main Mar 23, 2026
8 checks passed
@nedseb nedseb deleted the fix/broken-examples branch March 23, 2026 08:02
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Correct broken method calls in lis2mdl and wsen-pads examples.

2 participants