-
Notifications
You must be signed in to change notification settings - Fork 14
Update sensor error representation #310
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
Update sensor error representation #310
Conversation
This commit introduces the `SensorDiagnostic` message to represent errors and warnings reported by microgrid sensors. This message extends a standardized error code with contextual information useful for diagnostics, such as subsystem names, measured values, or vendor-specific insights. Signed-off-by: Tiyash Basu <[email protected]>
This commit renames the enum `SensorErrorCode` to `SensorDiagnosticCode` in the `sensors.proto` file. This change is made to better reflect the shared usage of this enum for both warnings and errors in microgrid sensors. Signed-off-by: Tiyash Basu <[email protected]>
This commit adds a new field `warnings` to the `SensorState` message in the `sensors.proto` file. This field is a repeated field of type `SensorDiagnostic`, which is used to represent warnings for the microgrid sensor. The `warnings` field is expected to have warnings if and only if the sensor is reporting warnings. The list will contain unique members, meaning no warning will exist twice in this list. This makes the `SensorState` message consistent with respect to `ElectricalComponentState`. Signed-off-by: Tiyash Basu <[email protected]>
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 updates the sensor error representation for microgrid sensors by introducing a new SensorDiagnostic message and aligning diagnostic reporting for both errors and warnings.
- Added a SensorDiagnostic message to encapsulate standardized diagnostic codes, vendor error codes, and descriptive messages.
- Updated SensorState to include a new warnings list and replaced the errors field to use SensorDiagnostic.
- Renamed SensorErrorCode to SensorDiagnosticCode to better represent its broader usage.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto | Introduces SensorDiagnostic, updates SensorState to include warnings, and renames SensorErrorCode to SensorDiagnosticCode. |
| RELEASE_NOTES.md | Adds documentation updates reflecting the new SensorDiagnostic message and the updated enum name. |
thomas-nicolai-frequenz
left a comment
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.
LGTM
No description provided.