Add ezspVersion to network backup metadata - #693
Conversation
|
@copilot Add the following comment to the newly-added code in |
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
| 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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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! 😆
* 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>
Add
ezspVersionto theinternalbackup metadata. Z2M will not load zigpy backups otherwise.