Skip to content

feat: Add steami_screen examples.#350

Open
Charly-sketch wants to merge 20 commits intomainfrom
feat/add-example-steami-screen
Open

feat: Add steami_screen examples.#350
Charly-sketch wants to merge 20 commits intomainfrom
feat/add-example-steami-screen

Conversation

@Charly-sketch
Copy link
Copy Markdown
Contributor

@Charly-sketch Charly-sketch commented Apr 3, 2026

Summary

Closes #270
Depends on PR #346

Changes

  • Create lib/steami_screen/examples/ and add practical examples for the steami_screen widgets.
  • Add hello_world.py to demonstrate the basic flow: clear(), title(), subtitle(), value(), and show().
  • Add gauge_demo.py to demonstrate a live circular gauge using VL53L1X distance data.
  • Add graph_demo.py to demonstrate a scrolling real-time graph using APDS9960 ambient light data. :
  • Add compass_demo.py to demonstrate the compass widget with LIS2MDL heading data.
  • Add face_gallery.py to cycle through all 6 built-in face expressions.
  • Also add extra widget examples for broader coverage:
    • comfort_bar_demo.py for a live temperature bar display with HTS221.
    • ddap_menu.py for a D-pad driven menu example.
    • watch.py for the analog watch widget using the built-in RTC.
  • Use the SSD1327Display wrapper consistently across the examples.

Checklist

  • ruff check passes
  • python -m pytest tests/ -k mock -v passes (no mock test broken)
  • Tested on hardware (if applicable)
  • README updated (if adding/changing public API)
  • Examples added/updated (if applicable)
  • Commit messages follow <scope>: <Description.> format

Add initial mock test coverage for the steami_screen driver.

## Added
- FakeDisplay backend to simulate a display device
- Basic property tests: center, radius, max_chars
- Core drawing API tests: clear, show, pixel, line, rect, text
- Text helpers: title, subtitle, value
- Widgets: bar, menu, face
- Advanced widgets smoke tests: graph, gauge, compass, watch
- Geometry helpers via public API: circle (outline and fill)
- Edge cases: empty subtitle, unknown face, invalid position fallback

Tests validate that high-level API correctly delegates to the display backend
by inspecting recorded calls.

## Notes
- Tests access the backend via `dev._d` due to runner scope limitations
- No hardware dependency (pure mock)

## Remaining work
- Validate exact layout/positions (not just call presence)
- Test scaling behavior (text scale, value rendering)
- Add snapshot/visual tests (e.g. Pillow backend)
- Add hardware tests for real displays (SSD1327, GC9A01)
- Improve coverage of edge cases (bounds, clipping, long text)
@Charly-sketch Charly-sketch marked this pull request as ready for review April 3, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add steami_screen examples.

1 participant