Open
Conversation
with example for analog clock
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
steami_screen.py(from tutorials repo) into a proper driver-style module underlib/steami_screen.Closes #269
Closes #268
Closes #267
Opens #349, #348
Changes
Migrated
steami_screenintolib/steami_screen/steami_screenSplit code into proper modules:
screen.py(Screen class + 10 widgets)colors.py(color helpers:rgb_to_gray4,rgb_to_rgb565,rgb_to_rgb8)__init__.py(exports Screen + color constants)manifest.pyAdapted internal imports (
from .colors import *)Added README
Added basic mock tests
Updated
calibrate_magnetometer.pyto use new moduleTask
lib/steami_screen/module (manifest.py, init.py, screen.py, colors.py)lib/steami_ssd1327/wrapper modulelib/steami_gc9a01/wrapper modulecalibrate_magnetometer.pyimportsmake firmware && make deployincludes steami_screen frozenChecklist
ruff checkpassespython -m pytest tests/ -k mock -vpasses<scope>: <Description.>format