Skip to content

chore(release): span-panel-api 3.8.0, schema-0 1.3.0 and schema-1 1.4.0 - #238

Merged
cayossarian merged 133 commits into
mainfrom
chore/release-3.8.0
Nov 10, 2026
Merged

cayossarian merged 133 commits into
mainfrom
chore/release-3.8.0

Conversation

@cayossarian

Copy link
Copy Markdown
Member

Final releases of the 3.8 pre-release line: span-panel-api 3.8.0, span-panel-api-schema-0 1.3.0 and span-panel-api-schema-1 1.4.0. This merges prerelease/3.8 into main, which already holds the Dependabot bumps merged since the line branched (#219, #220, #221, #222, #226), so the releases are cut from a tree that has both.

The last public releases are 3.6.2, schema-0 1.2.0 and schema-1 1.2.2. 3.7.0 and schema-1 1.3.0 were betas only, so their changes are part of these entries.

Version changes:

  • pyproject.toml: version 3.8.0; the extras require span-panel-api-schema-0>=1.3.0 and span-panel-api-schema-1>=1.4.0, stable floors in place of the betas'.
  • packages/schema-0/pyproject.toml: version 1.3.0, requiring span-panel-api>=3.8.0,<4.0.
  • packages/schema-1/pyproject.toml: version 1.4.0, requiring span-panel-api>=3.8.0,<4.0.
  • uv.lock: version lines only.

Changelogs:

  • Each [Unreleased] heading becomes its version: [3.8.0], [1.3.0], [1.4.0].
  • Entries name public versions only. The schema-0 entry requires span-panel-api 3.8.0 where it named 3.7.0, and the bootstrap entry names schema-0 1.3.0 and schema-1 1.4.0 where it named 1.3.0 for both.

README:

  • The protocol table gains EvseLockControlProtocol, the snapshot summaries the fields this release adds, the error table SpanPanelRateLimitError, and the project tree _ssl.py and mqtt/control.py.
  • The usage example tests lugs_at_service_entrance against None.
  • The schema-1 README names meters outside the panel and the masked tree export.

Checks:

  • pre-commit run --all-files: every hook passes.
  • Tests: 2229 passed, 7 skipped (the live-capture tests), 9 expected failures, coverage 96.95%.
  • Built-wheel metadata shows span-panel-api-schema-0>=1.3.0; extra == 'schema-0', span-panel-api-schema-1>=1.4.0; extra == 'schema-1', and span-panel-api<4.0,>=3.8.0 in both adapters, with no beta floor left.

Release order after merge: v3.8.0, then schema-0-v1.3.0, then schema-1-v1.4.0.

cayossarian and others added 30 commits October 8, 2026 15:20
…ng and reading shapes

Typed builders over device_from_topics for shapes the reference payloads
do not carry: a circuit-typed meter with no breaker space and no relay, a
panel with a given model and occupied positions, a declared feeds role,
two circuits sharing one meter and relay, panel, lugs and circuit
readings, a settable charger lock, and a battery named by the circuit
that feeds it. without_values keeps a declaration while dropping its
values, so a declared property that has not arrived stays distinct from
one never declared.

replay feeds any retained-topic tree to the schema-1 adapter the way the
broker does, and every builder's tree is replayed through it.

pytest.ini turns on strict markers and registers spec_only.

Part of the spanos3/r202639/03 batch 2 work.
…ircuits

Each synthetic device now carries its own description name, set when it
is built. Dropping values with without_values therefore leaves the
description unchanged, and no device is ever described by its id.

The hosted circuit builder can now declare no switch node at all, and it
takes meter and relay shared-with lists, which it publishes exactly as
given, including the circuit's own id or an id no device has. The shared
pair is built on those lists.

The declaration names and values are this suite's own throughout.

Part of the spanos3/r202639/03 batch 2 work.
The capture replay is measured against the code the pre-release line is
cut from, which reports unknown instead of constants and synthesises no
unoccupied positions. No conflicts.
…utside the panel

A circuit-typed device whose description declares no info/spaces is a
meter outside the panel, classified by its declaration rather than by its
values, and SpanCircuitSnapshot.measures_outside_panel reports it. Its
power is reported as published, import-positive, with imported energy as
consumed and exported energy as produced. Hosted circuits keep the
negated load frame unchanged, including while their values are pending.

A device that declares no switch node is neither controllable, sheddable
nor always on: an unvalued relay-controllable means controllable only
where a relay is declared. is_240v widens to bool | None and is None
where no pole count is published. The connect-time name wait asks only
for an info/name the device declares, so such a meter no longer holds
the wait to its timeout.

Part of the spanos3/r202639/03 batch 2 work.
Vendor the five masked reference captures r202639-a to r202639-e byte
for byte from electrification-bus/distribution-enclosure-simulator at
79aa07c, with that repository's MIT LICENSE copied beside them, a
provenance README and SHA256SUMS. A test pins every copied file's
digest and fails on an unpinned capture, a pin without a file, or
anything else in the directory; the byte-rewriting hooks skip the
copies.

reference_payloads.captures parses each capture into a typed,
read-only CaptureTree, merges its values back into the retained-topic
tree a broker holds, and replays that through the existing replay.
Selectors pick circuits by what a tree declares: hosted circuits,
circuit-typed devices with no breaker space, batteries a circuit feeds,
and circuits that list meter peers.

The replay tests are properties over every capture: each one is ready,
its snapshot names the serial, firmware and model its tree declares and
holds exactly its declared circuits, and a circuit whose values are
withheld stays declared and is waited on for its name. The selectors are
checked against evidence they do not read: the file parsed again with
plain json, the adapter's breaker spaces, each feeding circuit's
declared device type, and each peer's own list.

Part of the spanos3/r202639/03 batch 2 work.
tests/expected_failures.py lists tests by file and function with the reason each fails: behaviour a later change brings, or behaviour this library deliberately does not have. conftest marks them xfail(strict=True), so a listed test that starts passing fails the run until its row goes, and a row naming a function its module lacks stops the run.

Adds other_model_tree(), which reads a hand-authored tree from tests/fixtures/ for the acceptance tests that follow.

Part of the spanos3/r202639/03 batch 2 work.
Don's acceptance tests, ported unchanged from his work: test_schema_one_other_models.py and the hand-authored tree it reads, here at tests/fixtures/other_model_tree.json. Tests this line does not pass yet are listed in tests/expected_failures.py.

Part of the spanos3/r202639/03 batch 2 work.
The acceptance tests' publishes_solar_roles section, ported unchanged, with its rows in tests/expected_failures.py.

Part of the spanos3/r202639/03 batch 2 work.
… that name no test

The field-metadata acceptance test also needs shared-with to stop being a discovered property, so its reason names that beside the new readings. A row naming a helper rather than a test function now stops the run like any stale row, and a test cannot be listed as both pending and divergent.

Part of the spanos3/r202639/03 batch 2 work.
…vergent line

A strict xfail stops at its first failing line, so the two acceptance tests listed as divergent never reach their later assertions: the solar-role circuit's reading, the charger labelling, the empty pv snapshot, the relay requester, busbar current and frequency, and the shared relay. A companion module asserts them over the same trees; the readings and shared-relay cases are listed as pending.

Part of the spanos3/r202639/03 batch 2 work.
r202639: synthetic tree builders for tests
r202639: Don's acceptance tests for the r202639 library line
r202639: replay the reference captures
…er published

A battery, inverter or charger that declares info/model and never values
it no longer holds every connect and tree rebuild to the full name
timeout. Once every name and firmware version has arrived, a declared
model still unvalued after FEED_GRACE_S is taken as absent and reported
once at INFO, the same grace the inverter feed wait already had. The
model fills device metadata only, so a value that lands later moves no
key.

Each waited device now gets its own grace, so one that appears after
another's grace has run still waits a whole grace. The test replay
helpers take the adapter's clock.

Part of the spanos3/r202639/03 batch 2 work.
SpanBatterySnapshot.present says whether the panel's device tree
declares a battery. It is True from the moment the battery describes
itself, before any of its values arrive, so a battery whose state of
charge is never published is still reported as one, and False where the
tree declares none. The flat schema has no battery device to declare and
leaves it None.

Part of the spanos3/r202639/03 batch 2 work.
…s unvalued

lugs_at_service_entrance widens to bool | None. Upstream lugs that
declare connection/fed-by-device-id and have not published it have not
said what feeds them, and the feed may yet name a device, so the field
is None rather than True. It stays True where the lugs declare no feed
or publish it empty, and False where it names a device. The flat schema
keeps its True default.

Part of the spanos3/r202639/03 batch 2 work.
register_v2 raises SpanPanelRateLimitError, a SpanPanelAPIError, when the
panel answers HTTP 429, and does not retry. retry_after_s carries the
wait the panel asked for in seconds, from Retry-After: delta-seconds as
given, an HTTP-date as the seconds until that time, and None when the
header is absent, negative, infinite or neither form. The body and the
passphrase stay out of the message, as for every other refusal.

The CA download's 429 retry reads Retry-After through the same parser,
so it now honours an HTTP-date and no longer waits on an infinite value.
The passphrase rotation docstring names 504 beside 500 as an unknown
outcome. SpanPanelRateLimitError is exported.

Part of the spanos3/r202639/03 batch 2 work.
Two acceptance tests read the delay as retry_after and expect None for an
HTTP-date Retry-After. This library names it retry_after_s, in seconds,
and reads an HTTP-date as the seconds until that time, so both are known
divergences. The rows are inert until the tests land. A row may now name
a method of a Test class.

Part of the spanos3/r202639/03 batch 2 work.
SpanEvseSnapshot.lock_control addresses the charger's switch/lock-state,
on its own device and observed on the same property, and is present only
where that declaration carries $settable. A lock the charger reports
without accepting writes, or does not declare, has none, and the flat
schema has none.

The set-topic builder moves out of the adapter into
transport.control_target, so the relay, priority, charge-limit and lock
targets come from one place.

Part of the spanos3/r202639/03 batch 2 work.
A battery whose feeding circuit names it in connection/feeds-device-id
reports that circuit's feeds-device-status as connected, as an inverter
or a charger already does, where no device claims it through a fed-by-*
record. SpanBatterySnapshot.feed_circuit_id names the circuit. The
circuit keeps device_type "circuit", and a battery ahead of the upstream
lugs keeps reading its link from them.

Part of the spanos3/r202639/03 batch 2 work.
The manifest placed three single-space circuits on spaces 1 to 3, which
are outside the breaker positions a panel of the reference's model has.
They move to 9, 10 and 11, marked as a third deliberate divergence from
the emitter's example, and parent_child_tree.json is recaptured from the
pinned ebus-panel-sim 0.8.0. Only those three info/spaces values and the
wall-clock $description versions change.

The tests that pinned the old space, or added a circuit at a position
outside the model's range, follow.

Part of the spanos3/r202639/03 batch 2 work.
… for an unknown model

SpanPanelSnapshot.first_position and last_position say which breaker
positions the panel has. They come from the reported model through
PANEL_POSITIONS_BY_MODEL, and from the occupied spaces where the model is
not known. They are only a range: nothing is filled in over it. Where a
panel's circuits occupy spaces outside its model's range, the range stays
the table's and the adapter warns once for that panel, naming the model,
the range and the occupied extremes.

A model reported as UNKNOWN names no model. It reads as None, sizes the
panel 0 without a warning on every snapshot, and is not model drift.

SpanPanelSnapshot.publishes_solar_roles is True where any circuit
declares connection/feeds-role. The acceptance tests these satisfy leave
the expected-failure registry.

Part of the spanos3/r202639/03 batch 2 work.
SpanCircuitSnapshot.feeds_role reports a circuit's
connection/feeds-role as a FeedsRole, one of LOADS, SUBPANEL, SOLAR,
STORAGE, GENERATOR, MIXED or UNUSED. It is None where the circuit
declares no role, has not published it, or publishes a value outside
that set. The role changes nothing else: device_type stays as
published, and no inverter is made up for a circuit whose role is
solar. FeedsRole and FEEDS_ROLES are exported.

Part of the spanos3/r202639/03 batch 2 work.
The snapshot now reads a circuit's connection/feeds-role into
feeds_role, so it is an addressed property and no longer a discovery
row. The reference tree declares no role, so the discovery experiment
proves the entry on a circuit given the declaration.

Part of the spanos3/r202639/03 batch 2 work.
SpanCircuitSnapshot.meter_shared_with and relay_shared_with list the
other circuits one meter measures or one relay switches, read from
meter/ and switch/shared-with-device-ids. The circuit itself and ids
naming no circuit in the snapshot are dropped, and the rest are ordered
by device_id_order, under which circuit-9 sorts before circuit-10. Each
is None while the list is undeclared or unpublished, and () where it
names no known circuit.

shared_meter_groups groups the circuits one meter measures, keyed by
their first member, and is exported. Nothing is summed. Both lists are
addressed properties now, so they are no longer discovery rows or
extension readings. The acceptance tests these satisfy leave the
expected-failure registry.

Part of the spanos3/r202639/03 batch 2 work.
The parser now fills snapshot fields new in span-panel-api 3.8.0b1 and
imports device_id_order from its models, so the floor rises to 3.8.0b1
when that release is cut.

Part of the spanos3/r202639/03 batch 2 work.
…minal voltage and protection functions

The snapshot reads five properties where a panel declares them, each None
where it is undeclared or unpublished:

- SpanPanelSnapshot.busbar_current_a and frequency_hz from the panel's
  meter/busbar-current and meter/frequency;
- SpanPanelSnapshot.upstream_protection_rating_a from the upstream lugs'
  connection/overcurrent-protection;
- SpanCircuitSnapshot.nominal_voltage_v from info/nominal-voltage;
- SpanCircuitSnapshot.protection_functions from
  breaker/protection-functions, as ProtectionFunction members in
  published order, dropping any value outside PROTECTION_FUNCTIONS.

Each carries field metadata from its declaration and is no longer a
discovery row or an extension reading. A node that leaves one of them
out is not a gap, so no unresolved row appears where a panel does not
declare it. ProtectionFunction and PROTECTION_FUNCTIONS are exported.

The acceptance tests these satisfy leave the expected-failure registry.
The one that expects the lugs' overcurrent-protection to stay a
discovery row is registered as a known divergence, with a companion
test asserting the rest of it.

Part of the spanos3/r202639/03 batch 2 work.
eBus device types are hierarchical, and a subtype carries its parent's class. Adoption and the field-metadata lookups already treated `<class>.<x>` as `<class>`, but the snapshot roles, the inverter list, the grid-forming resolution, `has_circuit` and `find_node_by_type` matched by exact type, so a subtyped BESS, PV, EVSE, MID, circuit or inverter was read by nothing and adopted by nothing. Lugs, the charge-limit surface and `_lookup` matched by a bare prefix, which read a look-alike such as `lugsfoo` as lugs while adoption also adopted it.

`description.declares_class` is now the one answer to whether a declared type is a class or a subtype of it, and every reader of a type asks it.
…asked export (#228)

`placeholder_ids` recognised circuits and lugs by exact type, so a `circuit.<x>` was numbered by id order instead of by breaker space and a `lugs.<x>` lost its direction. Both now ask `declares_class`, and the exporter takes `DEVICE_TYPE_PREFIX`, `TYPE_CIRCUIT` and `TYPE_LUGS` from `const` rather than keeping copies. The short-type naming of other placeholders is unchanged.
The fidelity harness replayed a capture's values, perturbations and restores with its own handle_message calls, sending "" raw. Since a clear now reads as unpublished, a valued-empty value in a tree-v1 capture or masked export was measured as unpublished there while replay read it as valued. Both now send values through one shared helper, retained_payload, and harness tests plant a valued-empty fed-by-device-id and check it is measured as published and restored after perturbation.

Also pins that a value arriving after a clear, both ahead of the device's route, is the one held and delivered, and notes in handle_message that a $description cleared on its own is logged by the SDK at ERROR.
Read a cleared retained property as unpublished
…limit-bounds

# Conflicts:
#	packages/schema-1/CHANGELOG.md
Refuse a charge-current limit outside the declared range
…-classes

# Conflicts:
#	packages/schema-1/CHANGELOG.md
Read a subtyped device as its class
Masked tree export: description bounds, plain-text escapes, id-like serials
Carries the masked device-tree export and its follow-ups (#229, #231),
the subtype class fix (#228, #230), cleared retained values read as
unpublished (#232) and the charge-limit range (#233). schema-1 floors on
span-panel-api 3.8.0b2, whose masked-tree protocol and types it
implements and whose client reads a cleared value as unpublished; the
core schema-1 extra floors on 1.4.0b4. schema-0 stays 1.3.0b1. The
changelog entries are already under Unreleased, as a beta gets no
heading of its own.
chore(release): span-panel-api 3.8.0b2 and schema-1 1.4.0b4
SpanEvseSnapshot gains charge_current_limit_minimum_a and charge_current_limit_maximum_a, the integer range the charge-current limit declares in its $format. The schema-1 adapter fills them from the same resolved ChargeLimitProperty.bounds that evse_charge_limit_payload enforces, so a control offers exactly the range a write accepts. Each side is None where the charger declares no limit or no format, leaves that side open, or declares a format declared_integer_bounds will not interpret. The flat schema declares no range and leaves both None.
Report the charge-current limit range a SPAN Drive declares
Mask the panel's time zone and country code in the tree export
The measurement belongs in the pull request, not the changelog, and the
entry now reads like the others under Fixed.
docs(changelog): state the #223 fix in one sentence
Finals of 3.8.0b2, 1.3.0b1 and 1.4.0b4. The schema-0 and schema-1 extras floor on span-panel-api-schema-0 1.3.0 and span-panel-api-schema-1 1.4.0, and both adapters on span-panel-api 3.8.0, stable floors again in place of the betas'. Each changelog entry takes its version heading and names public versions only: 3.7.0 and schema-1 1.3.0 were never released, so the entries cite 3.8.0 and 1.4.0 where they cited those.
The protocol table gains EvseLockControlProtocol, the snapshot summaries the fields this release adds, the error table SpanPanelRateLimitError, and the project tree _ssl.py and mqtt/control.py. The usage example tests lugs_at_service_entrance against None, which it can now be. The schema-1 README names meters outside the panel and the masked tree export.
@cayossarian
cayossarian merged commit 3bae3ce into main Nov 10, 2026
6 checks passed
@cayossarian
cayossarian deleted the chore/release-3.8.0 branch November 10, 2026 17:12
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.

2 participants