Repository navigation
feat(ha): install and run Home Assistant ports on the node - #320
Open
Developer-Simon wants to merge 16 commits into
Open
Developer-Simon wants to merge 16 commits into
Developer-Simon wants to merge 16 commits into
Conversation
The runner now accepts the devices file as a top-level JSON array. The
legacy {"devices": [...]} object is still read until no node writes it.
Before the MQTT client is built, the runner exits with code 2 when the
port package energy_node_ha_<domain> is not installed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The core schema accepts services.ha_<name> sections through patternProperties, with service_id as the only field. The config validator now evaluates patternProperties, so matching keys are no longer rejected by additionalProperties false, and unsupported keywords inside those subschemas are refused like the rest. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Step 87 is an optional step, on by default, that sets up the Home Assistant ports. The manifest marks it with ha_ports true, and the bundle stages the port unit template at ha/energy-node-ha@.service, rendered to the target user like the other units. The step script bootstrap/87-*.sh comes in a later change, so until it exists the manifest carries step 87 without a fingerprint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ha_ports.py validates the selected ports against the signed catalog before anything is written: architecture, Python and layer versions, and the SHA-256 of the port wheel and its dependencies. plan writes the manifests and schemas only after all checks pass. config adds the services.ha_<domain> section once, record writes the installed state. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Domains from the selection, the catalog and the installed state must
match ^[a-z0-9_]{1,40}$. Wheel filenames that are empty, ".", "..", or
contain a slash or backslash are rejected explicitly. A malformed
catalog reports HA_PORTS_CATALOG_INVALID instead of a traceback. The
config step accepts a null services value and rejects any other
non-object. A selection that is not a list of strings is rejected.
SHA-256 comparisons ignore case.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tep 87 Step 87 reads the port selection, verifies the signed port catalog only when ports are selected, and runs the planner in lib/ha_ports.py. It then installs or removes the ports with pip, renders the port unit, writes manifests, schemas and empty device files, adds the config sections, and enables or restarts the services. The installed state is recorded for the update hint. Without a selection and without installed ports the step is skipped. The service script test skips 87 like 89, since 87 is not a service table entry. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e changed wheels Without a selection the planner no longer loads catalog.json and only emits remove lines, so deselecting ports works when ha-ports/ is gone. record with no domains writes an empty state without the catalog. When a changed wheel arrives for a port that is already installed, the step uninstalls the old package before installing the new one. pip would otherwise skip a rebuilt wheel with an unchanged version. Dependencies stay installed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rvice logs Diagnose reports the unit of every ha_*.json manifest next to the step units. The service log accepts ha-<domain> keys for manifests with an ha_port entry, through ValidateWith and PortUnits. The display name of ha_<domain>_devices reads "HA: <domain>". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…stant port units
read-journal accepts the key ha-<domain> when the domain matches
^[a-z0-9_]{1,40}$ and the manifest ha_<domain>.json exists. The unit is
energy-node-ha@<domain>.service. service_units also lists every enabled
energy-node-ha@*.service whose domain passes the same check, so
stop-services and start-services cover port units.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Step 87 installs the Home Assistant ports and has no services/ input, so the service step rule test must skip it like the 89 example. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The services object of config.schema.json declares ha_<name> entries via patternProperties. schema-form.js did not know that keyword, so a file with an ha_ port was reported as containing unknown fields and fell back to the raw editor. findUnknownKeys treats a key that fully matches a pattern as known and checks its value against that pattern's schema. renderNode renders such keys as plain children, so readNode writes them back on save. Cache version of schema-form.js bumped to 3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Squash-merge commit message
Highlight translations
Tour
noneSummary
Makes a node able to run Home Assistant ports: the runner reads the array devices format, step 87 installs, updates and removes ports from the signed catalog, and diagnostics, service logs and the system action helper know port units. The installer side follows in a second PR.
Checks
scripts/dev/check_tracked_secrets.shis clean.