feat: add brush coverage image entity with tooth diagram visualization#88
Open
deniskie wants to merge 3 commits into
Open
feat: add brush coverage image entity with tooth diagram visualization#88deniskie wants to merge 3 commits into
deniskie wants to merge 3 commits into
Conversation
00ff9f6 to
a4bb6ac
Compare
Add an image platform entity that renders a colour-coded dental arch SVG showing which zones were brushed and how much pressure was applied. The diagram is generated entirely in Python using math-based scalloped arcs — no external assets, no PIL dependency, no copyright concerns. Colour coding by pressure: - Grey: not brushed (0) - Green: light pressure (1-80) - Orange: medium pressure (81-160) - Red: high pressure (161-255) - New: image.py — OcleanBrushCoverageImage entity + SVG generation - New: tests/test_image.py — 27 tests - Register Platform.IMAGE in __init__.py - Add translations (en/de/es) - Add ImageEntity stub to test conftest Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extend the integration to support both 8-zone and 12-zone dental layouts. YD-series devices (YD000C/D/F/10) use 12 zones with an additional center column between left and right for each jaw. - const.py: TOOTH_AREA_NAMES_12, DATA_DENTAL_CAST, area_names_for_count() - protocol.py: dental_cast field on DeviceProtocol, TYPE1_12Z profile - parser.py: _build_area_stats accepts variable zone count, dental_cast parameter threaded through parse_notification to area parsers - coordinator.py: passes dental_cast to notification handler - sensor.py: creates 12 zone sensors (center zones unavailable on 8-zone) - image.py: SVG supports 3-section layout for 12-zone devices - translations: center zone names in en/de/es Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ImageEntity.__init__(self) instead of passing coordinator.hass; modern HA dropped the hass parameter, causing access_token to never be set up and the image proxy URL to render token=undefined in the frontend - Remove the available override on OcleanBrushCoverageImage so the entity stays reachable even when last_brush_areas is absent (OCLEANY3M never sends 2604 area enrichment pushes in paginated mode); async_image still returns None until real area data arrives - Update conftest ImageEntity stub and test expectations to match Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a4bb6ac to
09bd0ed
Compare
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.
Add an image platform entity that renders a colour-coded dental arch diagram showing which zones were brushed and how much pressure was applied. Uses pre-rendered WebP assets (dental_cast8 overlays on a background) from the official Oclean app, composited server-side via PIL with dynamic tinting (green/orange/red by pressure level).