Expose IDU serial number, firmware version, and model SKU#20
Merged
Conversation
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
There was a problem hiding this comment.
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, andfirmware_versionfields toIndoorUnit, and resolve them via an optional hardware map during snapshot parsing. - Build and pass an
indoor_unit_hardwaremap inSystemSnapshot.from_proto, and preserve resolved hardware fields inapply_indoor_unitduring stream-diff merges. - Add/adjust tests and update reference docs to reflect the new
IndoorUnitfields.
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). |
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.
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.
Fixes #19.
Summary
SystemSnapshot.from_protodiscardedindoor_unit_hardware, soIndoorUnitnever exposed a serial number, firmware version, or model SKU — unlikeOutdoorUnitandController. This adds that resolution, mirroring the existing outdoor-unit handling.Changes
models/indoor_unit.py— addmodel_sku,serial_number,firmware_versionfields;IndoorUnit.from_protonow accepts an optionalhw_mapand resolves these from the matching hardware entry (same pattern asOutdoorUnit.from_proto).models/system.py—SystemSnapshot.from_protobuildsidu_hw_mapfromindoor_unit_hardwareand passes it toIndoorUnit.from_proto;apply_indoor_unitpreserves the hardware fields across sparse stream diffs (stream diffs are parsed without a hw_map), matchingapply_outdoor_unit/apply_controller.test_system_snapshot_resolves_indoor_unit_hardwarecovering resolution and stream-diff preservation; existing system builders updated withindoor_unit_hardware=[].hds-entities.mdandmodels.md.Validation