Skip to content

Commit d0e83a9

Browse files
Rename SensorErrorCode to SensorDiagnosticCode in sensors.proto
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]>
1 parent 58c09c4 commit d0e83a9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Added new message `ElectricalComponentDiagnostic` to represent warnings and errors in microgrid electrical components.
1717
- The enum `ComponentErrorCode` has now been renamed to `ElectricalComponentDiagnosticCode` to better reflect its shared usage with warnings and errors.
1818
- Added new message `SensorDiagnostic` to represent warnings and errors in microgrid sensors.
19+
- The enum `SensorErrorCode` has now been renamed to `SensorDiagnosticCode` to better reflect its shared usage with warnings and errors.
1920

2021
## Bug Fixes
2122

proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ message SensorData {
158158
// !!! example "Typical Sensor Error"
159159
// ```json
160160
// {
161-
// "errorCode":
162-
// "SENSOR_ERROR_CODE_INTERNAL",
161+
// "diagnosticCode":
162+
// "SENSOR_DIAGNOSTIC_CODE_INTERNAL",
163163
// "vendorErrorCode": 2003,
164164
// "message": "Temperature sensor 3 reported 61.5°C (limit: 60°C)"
165165
// }
@@ -171,7 +171,7 @@ message SensorData {
171171
// using the vendor's official documentation.
172172
message SensorDiagnostic {
173173
// A standardized error code representing the category of the issue.
174-
SensorErrorCode error_code = 1;
174+
SensorDiagnosticCode diagnostic_code = 1;
175175

176176
// Optional vendor-provided error code for the error, for vendor-specific
177177
// insights or more granular diagnostics.
@@ -219,17 +219,18 @@ enum SensorStateCode {
219219
SENSOR_STATE_CODE_ERROR = 2;
220220
}
221221

222-
// A representation of all possible errors that can occur in sensors.
223-
enum SensorErrorCode {
222+
// A representation of all possible warnings and errors that can occur in
223+
// sensors.
224+
enum SensorDiagnosticCode {
224225
// Default value. No specific error is specified.
225-
SENSOR_ERROR_CODE_UNSPECIFIED = 0;
226+
SENSOR_DIAGNOSTIC_CODE_UNSPECIFIED = 0;
226227

227228
// The sensor is reporting an unknown or an undefined error, and the sender
228229
// cannot parse the sensor error to any of the variants below.
229-
SENSOR_ERROR_CODE_UNKNOWN = 1;
230+
SENSOR_DIAGNOSTIC_CODE_UNKNOWN = 1;
230231

231232
// Error indicating an internal error within the sensor.
232-
SENSOR_ERROR_CODE_INTERNAL = 2;
233+
SENSOR_DIAGNOSTIC_CODE_INTERNAL = 2;
233234
}
234235

235236
// Representation of a sampled sensor metric along with its value.

0 commit comments

Comments
 (0)