Repository navigation
feat: foundation (API client, config flow, coordinator, CI) - #1
Merged
Merged
Conversation
- pyproject.toml: ruff, mypy (strict) and pytest (asyncio_mode=auto) for Python 3.13.2+ (HA 2026.1 minimum); CI and tests run on Python 3.14 - CI: hassfest, HACS (category integration), ruff check/format, mypy, pytest - hacs.json targeting Home Assistant 2026.1.0 - .gitattributes forces LF so strings.json and en.json stay byte-identical - CLAUDE.md: correct the Python target, document instance_id as unique_id and that pytest needs Linux/macOS/WSL (HA's test plugin imports fcntl) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Foundation of the smart_frame_engine integration, grounded in the Smart Frame Engine API contract v1.1 (instance_id / instance_name). - api.py: typed async client on HA's shared session; health handshake, status, config + Family Mode, ambient context (TTL, clear by field), force refresh, title card, wake-up, push and current/preview images - const.py: SUPPORTED_API_VERSION and all 18 capability flags - config_flow.py: Zeroconf (open vs key/password), manual setup, reauth, options flow (polling interval); instance_id is the unique_id so DHCP address changes update the existing entry - coordinator.py: health + status (+ ambient) polling, compatibility check on every refresh with a persistent Repair issue that clears itself, capability cache, shared DeviceInfo - entity.py, __init__.py, diagnostics.py (api_key redacted) - strings.json / translations en + fr Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
100 tests: api (all auth modes, 401, 422, timeouts, compatibility matrix), config flow (Zeroconf open/key, manual, duplicate address update, incompatible api_version, reauth, options), coordinator (capability cache, Repair issue creation and auto-resolution, reauth on 401, instance mismatch), diagnostics redaction, entity device info, manifest ordering and en/fr translation parity. 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 1 "Foundation" of the
smart_frame_engineintegration: everything the entity platforms and services of later milestones will build on. No entities or services yet.api.py,const.py): typed async client on HA's shared session; health/compatibility handshake, status, config + Family Mode, ambient context (per-field TTL, clear by field), force refresh, title card, wake-up, push, current/preview image.SUPPORTED_API_VERSION = 1and all 18 capability flags. Exceptions:SmartFrameConnectionError,SmartFrameAuthError,SmartFrameIncompatibleError(+SmartFrameApiError/SmartFrameValidationErrorfor 4xx/5xx and 422).api_keyasked only whenauth != open), manual setup (host + port 8080, health probe first), reauth, options flow (polling interval). The engine'sinstance_idis theunique_id, so a DHCP change updates the existing entry instead of duplicating it.min_api_version <= 1 <= api_versionon every refresh, creates a persistent Repair issue saying which side to update, and removes it automatically once compatible. 401 raisesConfigEntryAuthFailed; connection errors raiseUpdateFailed. Capabilities are cached for platforms/services.api_keyredacted), en/fr translations (strings.json==en.json), CI (hassfest, HACS, ruff, mypy, pytest),hacs.json, manifest.Things to know before merging
instance_id/instance_namein/api/healthand the Zeroconf TXT). It is still open, so I grounded on that branch. Engines without it (1.0.0-rc.1) are refused with a clearinstance_id_missingmessage. Please merge #43 first.is_lockedis not implemented: it is not inAPI_CONTRACT.md/openapi.json. Ambient context supports the documented fields andttl_minutesonly.pytest-homeassistant-custom-componentneed >= 3.14.requires-python = ">=3.13.2"; CLAUDE.md corrected (it said 3.12+).server_outdated/integration_outdatedinstead.GET /api/config, becauseGET /api/statusis public inkeymode and cannot prove a key is valid. The coordinator's ambient-context call plays the same role while polling.voluptuous: HA 2026.10 moved toprobatiobut keeps a runtime shim, so this works on every 2026.x release; a tiny helper isolates the type-only mismatch.__init__.pyin CLAUDE.md) is deferred: no services in this milestone.Verification
Run on a fresh Linux clone of this branch (Python 3.14, HA 2026.10.4):
ruff check .: passedruff format --check .: passedmypy custom_components: passed (strict)pytest: 100 passed. I also mutation-checked six behaviours (Repair issue cleanup, compatibility direction, redaction, header auth, Zeroconf de-duplication, 401 handling): each breakage is caught by a test.Not verified locally: hassfest and HACS only run in CI (the
brandsHACS check is ignored, as it is only required for the HACS default list).HA's test plugin imports
fcntl, sopytestcannot run on native Windows; I ran it under WSL.🤖 Generated with Claude Code