Repository navigation
feat: entity platforms and services (Milestone 2) - #2
Merged
Merged
Conversation
- api: typed frame telemetry (online, battery, charging, rssi, firmware, last seen), last delivery details, active refresh rule, image identity (sha256 + processed_at) and provider details; naive timestamps are UTC - coordinator: fetch GET /api/config when the family_mode capability is advertised, expose async_action (maps engine errors to translated HomeAssistantError / ServiceValidationError and starts reauth on 401), and reload the entry when the engine's capability set changes - diagnostics: redact image details, presence and boost_people (personal data) and add family_enabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Platforms (capability-gated where the contract defines a flag): - binary_sensor: engine connected, frame online/charging, delivery pending, temporary image, quiet hours - sensor: engine version, image source, refresh mode (enum), media title, ambient context summary (ambient_context), last delivery, frame last seen, battery, Wi-Fi signal - switch: Family Mode (family_mode), reads config.family.enabled - button: refresh image (force_refresh), wake up frame (frame_wakeup) - image: current frame image, cached until sha256/processed_at changes, falling back to /api/preview.jpg on 404 Services, registered once from async_setup, each checking the engine's capability and raising a translated ServiceValidationError when missing: set_ambient_context, clear_ambient_context (ambient_context) and send_title_card (title_card). Translations (strings.json, en, fr) cover entities, states, services, selectors and the new exceptions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Per-platform tests (states, attributes, categories, availability), image caching / 404 fallback / change detection, service payloads, schema limits, capability and target validation, engine error mapping and reauth, entry reload on capability change, diagnostics redaction, and consistency checks between services.yaml, the schemas and the translations. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- wait (bounded) for a timer-driven setup instead of relying on async_block_till_done, which returns before the first off-loop import of a platform's dependencies finishes - import integration modules at module level in test_metadata so they resolve before the test plugin registers its own custom_components Every test now also passes when run alone in its own process. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Show status.release (the git/Docker tag spelling) for the engine version and the device sw_version, falling back to the PEP 440 health version on older engines. Know the new smart_mix_kinds capability flag. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Milestone 2: the entity platforms and services, built on the foundation and grounded in the Smart Frame Engine API contract v1.1 (
docs/API_CONTRACT.mdanddocs/openapi.jsonon upstreammain, unchanged since the foundation PR).Platforms (one device per engine; optional ones appear only when the engine advertises the capability, and are rebuilt automatically if the engine's capabilities change after an update):
ambient_context), last delivery, frame last seen, frame battery, Wi-Fi signal (disabled by default)family_mode): readsconfig.family.enabled, toggles withPUT /api/configthen refreshesforce_refresh), Wake up frame (frame_wakeup)/api/current.jpg, falling back to/api/preview.jpgon 404, cached untilsha256/processed_atchangeServices (registered from
async_setup; each checks the capability before sending anything and raises a translatedServiceValidationError):set_ambient_contextandclear_ambient_context(ambient_context),send_title_card(title_card). Limits come fromopenapi.json(1..10080 minutes, 20 list items, 80/200 characters).Translations (
strings.json,en.json,fr.json) cover entity names, states, services, selectors and exceptions, and a test enforces en/fr key and placeholder parity and thatservices.yaml, the schemas and the translations agree.Decisions worth a look
Grounding corrections to the request. The contract defines no "photographer/album" fields: image metadata is
source,template,ephemeral,pushed,processed_at,expires_atand a free-formdetailsobject, so those are what is exposed. "Active source / mode" iscurrent_image.sourceplusscheduler.active_rule.source(pinned|smart_mix|last, an enum sensor).ttl_minutes: null("until cancelled") for title cards is not exposed: omitting it applies the engine's 60-minute default.Privacy.
detailscan contain people and places. It is visible on the media title sensor but excluded from the recorder (_unrecorded_attributes), and diagnostics now redactdetails,presenceandboost_people.The "Engine connected" sensor stays available while the engine is down (it reports
offinstead of going unavailable); everything else goes unavailable.Services target an engine with an optional
config_entry_id(optional when only one is configured) rather thantarget:. The helper that resolves device targets changed signature across HA versions, and the 2026.1.0 minimum matters.Version compatibility checked against the HA 2026.1.0 wheel:
BinarySensorDeviceClasshas noconstmodule there, so it is imported from the package (with a narrow type-checker ignore).Foundation fixture correction: the foundation tests used an invented
telemetryshape; fixed to the realFrameTelemetry/FrameInfoschema (info.battery_percent, ...).A 401 while pressing a button or calling a service starts reauthentication, not just an error.
Engine rc.3 / contract 1.2 (additive,
api_versionstill 1): the engine version sensor and the devicesw_versionshowstatus.release(1.0.0-rc.3, matching the git/Docker tag) and fall back to the PEP 440health.versionon older engines. The newsmart_mix_kindscapability flag is known (19 flags); nothing else is used.Verification
Fresh Linux clone of this branch (Python 3.14, HA 2026.10.4):
ruff check .: passedruff format --check .: passedmypy custom_components: passed (strict)pytest: 204 passed (203 before the rc.3 follow-up; the 4-run and per-test-isolation sweeps were done on the 203) (this found and fixed two order-dependent tests)details, ...) are each caught by a test.Not verified locally: hassfest and HACS run in CI only. Also not exercised against a real engine: all HTTP is mocked from the contract's schemas.
🤖 Generated with Claude Code