Skip to content

Add ezspVersion to network backup metadata - #693

Merged
puddly merged 3 commits into
devfrom
copilot/add-ezspversion-to-internal-metadata
Oct 24, 2025
Merged

Add ezspVersion to network backup metadata#693
puddly merged 3 commits into
devfrom
copilot/add-ezspversion-to-internal-metadata

Conversation

Copilot AI commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Add ezspVersion to the internal backup metadata. Z2M will not load zigpy backups otherwise.

@puddly

puddly commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

@copilot Add the following comment to the newly-added code in load_network_info: Z2M will not load EZSP backups without this internal key.

Set ezspVersion to the EZSP protocol version in the metadata dictionary. This value is included in the internal metadata when backups are serialized to the Open Coordinator Backup format.

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
@codecov

codecov Bot commented Oct 24, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.52%. Comparing base (cdd1217) to head (ed11a47).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #693   +/-   ##
=======================================
  Coverage   99.52%   99.52%           
=======================================
  Files          58       58           
  Lines        3971     3971           
=======================================
  Hits         3952     3952           
  Misses         19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI changed the title [WIP] Add ezspVersion to internal metadata key Add ezspVersion to network backup metadata Oct 24, 2025
Copilot AI requested a review from puddly October 24, 2025 22:37
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>

Copilot AI commented Oct 24, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Add the following comment to the newly-added code in load_network_info: Z2M will not load EZSP backups without this internal key.

Done in ed11a47. Added the comment explaining that Z2M will not load EZSP backups without this internal key.

@puddly
puddly marked this pull request as ready for review October 24, 2025 22:51
@puddly
puddly merged commit 07a2e42 into dev Oct 24, 2025
38 checks passed
flow_control.name.lower() if flow_control is not None else None
),
# Z2M will not load EZSP backups without this internal key
"ezspVersion": ezsp.ezsp_version,

@TheJulianJES TheJulianJES Oct 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this in the correct place for Z2M now? Shouldn't this be located in metadata.internal.ezspVersion for Z2M, and not metadata.ezsp.ezspVersion? Reference: https://github.com/Koenkk/zigbee-herdsman/blob/47ae47dbb70dfae4fe38a2458fc0d0250165f0d5/src/utils/backup.ts#L95

@puddly puddly Oct 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When exporting from the internal Zigpy NetworkBackup to the old JSON format, the metadata key contents are merged into internal: https://github.com/zigpy/zigpy/blob/1aba0f1c15af94120349c0ba18a58bd9ced8c484/zigpy/backups.py#L286-L320

We don't actually use internal in zigpy, it was renamed to metadata.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, thanks for linking that. I only had the new structure from a HA downloaded backup in mind 😅
We should have a unified coordinator backup at some point! 😆

mineshaftgap pushed a commit to mineshaftgap/bellows that referenced this pull request Jun 11, 2026
* Initial plan

* Add ezspVersion to the internal metadata key

Set ezspVersion to the EZSP protocol version in the metadata dictionary. This value is included in the internal metadata when backups are serialized to the Open Coordinator Backup format.

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>

* Add comment explaining Z2M requirement for ezspVersion

Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
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.

3 participants