Skip to content

Lattice 1/3: device-mapping framework (read-only)#4081

Closed
mgazza wants to merge 2 commits into
mainfrom
lattice-pr1-framework
Closed

Lattice 1/3: device-mapping framework (read-only)#4081
mgazza wants to merge 2 commits into
mainfrom
lattice-pr1-framework

Conversation

@mgazza

@mgazza mgazza commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Reworked to read-only after maintainer feedback (control is premature without a common API; the near-term value is mapping devices + sensors). Control is now a separate, deferred design — see lattice-spec#4.

First of a 3-PR train that maps the devices on a site and inventories their sensors. Read-only, flag-gated (lattice_projection_enable, default off), touches no control path.

Commits:

  1. read-only core — lattice.py: Fragment/Node/Sensor/AccessPath, merge_fragments (one node per device by serial, ranked access paths), resolve_sensor, device_fragment.
  2. projection + component + flag — LatticeProjection (discover producers, merge, resolve sensor entity) + LatticeComponent (logs the merged device map) + the enable switch.

Tests: 12 standalone unit tests (python -m pytest apps/predbat/test_lattice.py).

Train: PR1 (this) → 2 gateway/GE-Cloud producers → 3 Fox/Solax/Solis producers.

🤖 Generated with Claude Code

mgazza and others added 2 commits June 19, 2026 08:10
…resolve)

Pure, dependency-free model: Fragment/Node/Sensor/AccessPath, merge_fragments (one node per
device by serial, ranked access paths, combined sensors), resolve_sensor (preferred entity), and
the device_fragment builder. READ-ONLY by design — control is a separate, deferred model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LatticeProjection discovers any component publishing a fragment, merges them into the site map,
and resolves a device's sensor to its preferred entity. LatticeComponent (registered, phase 2)
rebuilds + logs the merged map when lattice_projection_enable is on; no-op when off (default).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mgazza mgazza force-pushed the lattice-pr1-framework branch from 884e264 to 104da38 Compare June 19, 2026 07:17
@mgazza mgazza changed the title Lattice 1/4: projection framework (dormant, flag-gated) Lattice 1/3: device-mapping framework (read-only) Jun 19, 2026
@mgazza

mgazza commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #4147, a single consolidated draft covering the whole Lattice read-slice + merge work (this branch's commits are included there). Closing to keep one draft PR instead of a stack.

@mgazza mgazza closed this Jun 29, 2026
@mgazza mgazza deleted the lattice-pr1-framework branch June 29, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant