-
Notifications
You must be signed in to change notification settings - Fork 60
chore: Add additional Home data to diagnostics #723
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
chore: Add additional Home data to diagnostics #723
Conversation
2186d58 to
0bd78b7
Compare
Add home API data including products devices, rooms, etc and increase the number of redacted fields. Add a device manager snapshot test to verify which fields are redacted.
0bd78b7 to
aae0e41
Compare
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 adds comprehensive home API data (devices, products, rooms, etc.) to the diagnostics output and enhances data redaction by increasing the number of redacted fields and adding selective field preservation via KEEP_KEYS.
Key changes:
- Adds home_data to diagnostic output alongside existing device and diagnostics information
- Implements path-based redaction logic to selectively preserve non-sensitive product and schema information
- Adds snapshot test to verify correct field redaction behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| roborock/diagnostics.py | Adds KEEP_KEYS mechanism for selective field preservation and expands REDACT_KEYS with home data fields (id, name, productId, etc.) |
| roborock/devices/device_manager.py | Stores home_data and restructures diagnostic_data() to return home_data, devices, and diagnostics sections |
| roborock/devices/device.py | Refactors diagnostic_data() to apply redaction to entire structure for correct path tracking |
| tests/devices/test_device_manager.py | Adds snapshot test for diagnostics and updates assertions for new structure |
| tests/devices/snapshots/test_device_manager.ambr | New snapshot file capturing expected diagnostic output with redaction |
| tests/devices/snapshots/test_v1_device.ambr | Updates snapshots to reflect additional redacted fields (name, productId) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| KEEP_KEYS = { | ||
| # Product information no unique per user | ||
| "product.id", | ||
| "product.schema.id", | ||
| "product.schema.name", | ||
| # Room ids are likely unique per user, but don't seem too sensitive and are | ||
| # useful for debugging | ||
| "rooms.id", | ||
| } |
Copilot
AI
Jan 7, 2026
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.
The KEEP_KEYS entries use singular form "product" but the actual field name in HomeData is "products" (plural). This causes product information to be incorrectly redacted in home_data.
The KEEP_KEYS should include:
products.id(notproduct.id)products.schema.id(notproduct.schema.id)products.schema.name(notproduct.schema.name)
The current entries only work for the devices section where each device has a single product field, but they don't match the path products.id when processing the home_data.products list.
Add home API data including products devices, rooms, etc and increase the number of redacted fields. Add a device manager snapshot test to verify which fields are redacted.