-
Notifications
You must be signed in to change notification settings - Fork 363
fix: Improve backup corruption message #1538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 refactors socket and backup utility functions by consolidating them into a single src/adapter/utils.ts file. The changes eliminate code duplication and improve maintainability by centralizing common adapter utilities.
Key changes:
- Moves
isTcpPathandparseTcpPathfunctions fromsocketPortUtils.tstoutils.ts - Adds a new
readBackupfunction toutils.tsfor centralized backup file reading - Updates all adapter files to use the new centralized utility functions
- Removes the obsolete
socketPortUtils.tsfile
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/adapter/utils.ts | New centralized utility file containing TCP path parsing and backup reading functions |
| src/adapter/socketPortUtils.ts | Deleted file - functionality moved to utils.ts |
| src/adapter/zoh/adapter/zohAdapter.ts | Updated import to use new utils location |
| src/adapter/zigate/driver/zigate.ts | Updated imports and function calls to use new utils location |
| src/adapter/zboss/uart.ts | Updated imports and function calls to use new utils location |
| src/adapter/z-stack/znp/znp.ts | Updated imports and function calls to use new utils location |
| src/adapter/z-stack/adapter/adapter-backup.ts | Refactored to use new centralized readBackup function |
| src/adapter/ezsp/driver/uart.ts | Updated imports and function calls to use new utils location |
| src/adapter/ezsp/adapter/backup.ts | Refactored to use new centralized readBackup function |
| src/adapter/ember/uart/ash.ts | Updated imports and function calls to use new utils location |
| src/adapter/ember/adapter/emberAdapter.ts | Refactored to use new centralized readBackup function, removed unused imports |
| src/adapter/deconz/driver/driver.ts | Updated imports and function calls to use new utils location |
| src/adapter/deconz/adapter/deconzAdapter.ts | Refactored to use new centralized readBackup function |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Somewhat related, should Should also look into moving the entire "port" (serial or tcp) out of drivers, we can init it from Adapter, and send it to the driver. |
|
Agree with both points, I think the only con of removing Ready for merge? |
Based on feedback given in Koenkk/zigbee2mqtt#11767