span-panel-api-schema-0 1.1.2__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,15 @@ rather than by this version number. A release here means this parser changed, ne
9
9
 
10
10
  Pre-releases are not listed separately. A beta is a step towards the next public version, so its changes are folded into that version's entry as they land and are described against the last public release, never against the beta before it.
11
11
 
12
+ ## [1.2.0]
13
+
14
+ The panel's one inverter is reported through `pv_inverters` as well as `pv`. Requires `span-panel-api` **3.6.0 or newer**.
15
+
16
+ ### Added
17
+
18
+ - **`pv_inverters` holds the panel's one inverter** under the key `span-panel-api-schema-1` gives it, so a consumer can read every panel through that field.
19
+ - **`pv.device_id` and `pv.node_id`** give the inverter's flat node id and its `pv_inverters` key.
20
+
12
21
  ## [1.1.2]
13
22
 
14
23
  The reference schema document this parser is tested against now ships in the wheel.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: span-panel-api-schema-0
3
- Version: 1.1.2
3
+ Version: 1.2.0
4
4
  Summary: Flat-schema (data-model-version absent) parser for span-panel-api
5
5
  Project-URL: Homepage, https://github.com/SpanPanel/span-panel-api
6
6
  Project-URL: Issues, https://github.com/SpanPanel/span-panel-api/issues
7
7
  Author: SpanPanel
8
8
  License-Expression: MIT
9
9
  Requires-Python: <4.0,>=3.14
10
- Requires-Dist: span-panel-api<4.0,>=3.1.0
10
+ Requires-Dist: span-panel-api<4.0,>=3.6.0
11
11
  Description-Content-Type: text/markdown
12
12
 
13
13
  # span-panel-api-schema-0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "span-panel-api-schema-0"
3
- version = "1.1.2"
3
+ version = "1.2.0"
4
4
  description = "Flat-schema (data-model-version absent) parser for span-panel-api"
5
5
  authors = [
6
6
  {name = "SpanPanel"}
@@ -16,7 +16,10 @@ dependencies = [
16
16
  # for `set_*_target` instead of `set_*_topic`. Against 3.0.x this wheel is
17
17
  # rejected at discovery for carrying names that bootstrap does not require —
18
18
  # so the floor moves with the rename rather than trailing it.
19
- "span-panel-api>=3.1.0,<4.0",
19
+ # Raised to 3.6.0, the first bootstrap whose snapshot carries `pv_inverters`
20
+ # and the inverter's `device_id` and `node_id`, which this parser fills.
21
+ # Against an earlier one, building a snapshot fails on those arguments.
22
+ "span-panel-api>=3.6.0,<4.0",
20
23
  ]
21
24
 
22
25
  [project.urls]
@@ -423,13 +423,18 @@ class HomieDeviceConsumer:
423
423
  feed = self._acc.get_prop(pv_node, "feed")
424
424
  rel_pos = self._acc.get_prop(pv_node, "relative-position")
425
425
 
426
+ feed_circuit_id = normalize_circuit_id(feed) if feed else None
426
427
  return SpanPVSnapshot(
427
428
  vendor_name=vn if vn else None,
428
429
  model=pn if pn else None,
429
430
  software_version=sw if sw else None,
430
431
  nameplate_capacity_w=_parse_float(nc) if nc else None,
431
- feed_circuit_id=normalize_circuit_id(feed) if feed else None,
432
+ feed_circuit_id=feed_circuit_id,
432
433
  relative_position=rel_pos.upper() if rel_pos else None,
434
+ device_id=pv_node,
435
+ # The same key schema_1 gives this inverter, so a consumer's handle
436
+ # for it survives the panel's upgrade to the parent/child schema.
437
+ node_id=feed_circuit_id or pv_node,
433
438
  )
434
439
 
435
440
  def _build_evse_devices(self) -> dict[str, SpanEvseSnapshot]:
@@ -726,5 +731,8 @@ class HomieDeviceConsumer:
726
731
  circuits=circuits,
727
732
  battery=battery,
728
733
  pv=pv,
734
+ # Flat publishes one inverter at most, so this is `pv` again, keyed
735
+ # as schema_1 keys each of its inverters.
736
+ pv_inverters={pv.node_id: pv} if pv.node_id is not None else {},
729
737
  evse=evse,
730
738
  )