DRY Refactoring — Eliminate 3 Code Duplications
-110 lines, +245 lines (net -50 lines of duplicated logic, +28 tests)
Changes
parse_hex_color()→core/models.py— single source of truth for hex color parsing, previously duplicated in CLI and 2 API modulesdispatch_result()→api/models.py— unified API response helper stripping non-serializable keys, previously duplicated in api/display and api/ledImageService.encode_for_device()→services/image.py— Strategy pattern for JPEG vs RGB565 encoding, previously duplicated in services/device and services/display- Clean stale
.gitignoreentries - 28 new tests with pytest fixtures
- 2509 tests passing, ruff clean, pyright 0 errors
Files Changed
16 files across 4 layers: core/, services/, api/, cli/, plus 3 test files