Skip to content

Expose IDU serial number, firmware version, and model SKU#20

Merged
eman merged 3 commits into
mainfrom
fix/idu-hardware-serial-firmware
Jul 4, 2026
Merged

Expose IDU serial number, firmware version, and model SKU#20
eman merged 3 commits into
mainfrom
fix/idu-hardware-serial-firmware

Conversation

@eman

@eman eman commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Fixes #19.

Summary

SystemSnapshot.from_proto discarded indoor_unit_hardware, so IndoorUnit never exposed a serial number, firmware version, or model SKU — unlike OutdoorUnit and Controller. This adds that resolution, mirroring the existing outdoor-unit handling.

Changes

  • models/indoor_unit.py — add model_sku, serial_number, firmware_version fields; IndoorUnit.from_proto now accepts an optional hw_map and resolves these from the matching hardware entry (same pattern as OutdoorUnit.from_proto).
  • models/system.pySystemSnapshot.from_proto builds idu_hw_map from indoor_unit_hardware and passes it to IndoorUnit.from_proto; apply_indoor_unit preserves the hardware fields across sparse stream diffs (stream diffs are parsed without a hw_map), matching apply_outdoor_unit / apply_controller.
  • Tests — new test_system_snapshot_resolves_indoor_unit_hardware covering resolution and stream-diff preservation; existing system builders updated with indoor_unit_hardware=[].
  • Docs — updated hds-entities.md and models.md.

Validation

  • ruff check + format
  • mypy
  • pytest (274 passed, 88.6% coverage)
  • mkdocs build --strict

SystemSnapshot.from_proto discarded indoor_unit_hardware, so IndoorUnit
never exposed serial/firmware/model, unlike OutdoorUnit and Controller.

- Add model_sku, serial_number, firmware_version fields to IndoorUnit
- IndoorUnit.from_proto now accepts hw_map and resolves them from
  indoor_unit_hardware, mirroring OutdoorUnit.from_proto
- Build idu_hw_map in SystemSnapshot.from_proto and pass it through
- Preserve hardware fields across sparse stream diffs in
  apply_indoor_unit, matching apply_outdoor_unit/apply_controller

Fixes #19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #19 by wiring HomeDatastoreSystem.indoor_unit_hardware into SystemSnapshot.from_proto so IndoorUnit instances can expose hardware metadata (serial number, firmware version, model SKU), mirroring the existing outdoor-unit/controller behavior and preserving these fields across sparse stream diffs.

Changes:

  • Add model_sku, serial_number, and firmware_version fields to IndoorUnit, and resolve them via an optional hardware map during snapshot parsing.
  • Build and pass an indoor_unit_hardware map in SystemSnapshot.from_proto, and preserve resolved hardware fields in apply_indoor_unit during stream-diff merges.
  • Add/adjust tests and update reference docs to reflect the new IndoorUnit fields.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_models_from_proto.py Adds coverage for resolving IDU hardware info from indoor_unit_hardware and preserving it across stream diffs; updates snapshot builders to include indoor_unit_hardware.
src/quilt_hp/models/system.py Builds idu_hw_map, passes it into IndoorUnit.from_proto, and attempts to preserve IDU hardware fields during apply_indoor_unit.
src/quilt_hp/models/indoor_unit.py Adds hardware fields to IndoorUnit and resolves them from indoor_unit_hardware via lookup_hardware.
docs/reference/models.md Updates the IndoorUnit model reference to include model_sku and firmware_version.
docs/reference/hds-entities.md Documents the new IndoorUnit hardware fields and their source (indoor_unit_hardware).

Comment thread src/quilt_hp/models/system.py Outdated
apply_indoor_unit gated serial/firmware preservation on model_sku being
present, so a stream diff would erase serial/firmware when model_sku was
absent (real IDUs report model_sku=N/A). Preserve model_sku, serial_number
and firmware_version independently. Apply the same fix to apply_outdoor_unit
and apply_controller, which shared the coupled pattern.
@eman
eman merged commit 846faa3 into main Jul 4, 2026
5 checks passed
@eman
eman deleted the fix/idu-hardware-serial-firmware branch July 4, 2026 15:50
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.

IndoorUnit does not expose serial number / firmware version (indoor_unit_hardware discarded)

2 participants