Skip to content

Commit 819304a

Browse files
Rename vendor error code and update documentation (#316)
2 parents 6e1c00e + 7912d10 commit 819304a

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ message ElectricalComponentDiagnostic {
488488

489489
// Optional vendor-provided error code for the error, for vendor-specific
490490
// insights or more granular diagnostics.
491-
optional uint32 vendor_error_code = 2;
491+
optional uint32 vendor_diagnostic_code = 2;
492492

493493
// Optional human-readable message providing additional context.
494494
string message = 3;
@@ -503,21 +503,33 @@ message ElectricalComponentState {
503503
// List of operational states currently active for the component.
504504
//
505505
// !!! note
506-
// The list must not contain duplicate state codes.
506+
// This list is treated as a set, and therefore its members will be unique,
507+
// i.e., no state will exist twice in this list.
508+
//
509+
// !!! note
510+
// If the state is `ELECTRICAL_COMPONENT_STATE_CODE_ERROR`, then the
511+
// electrical component is in an error state. In such cases, the `errors`
512+
// field will be populated with the list of errors.
507513
repeated ElectricalComponentStateCode states = 2;
508514

509515
// List of non-critical warnings detected for the component.
510516
//
511517
// !!! note
518+
// This list is treated as a set, and therefore its members will be unique,
519+
// i.e., no state will exist twice in this list.
520+
//
521+
// !!! note
512522
// Warnings may be reported even when the component is operational.
513-
// No duplicate warning codes allowed.
514523
repeated ElectricalComponentDiagnostic warnings = 3;
515524

516525
// List of critical errors currently affecting the component.
517526
//
518527
// !!! note
519-
// This list is expected to be populated only when the component is in an
520-
// error state.
521-
// No duplicate error codes allowed.
528+
// This list is treated as a set, and therefore its members will be unique,
529+
// i.e., no state will exist twice in this list.
530+
//
531+
// !!! note
532+
// This list is expected to have errors if and only if the electrical
533+
// component is in an error state.
522534
repeated ElectricalComponentDiagnostic errors = 4;
523535
}

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ message SensorDiagnostic {
173173
// A standardized error code representing the category of the issue.
174174
SensorDiagnosticCode diagnostic_code = 1;
175175

176-
// Optional vendor-provided error code for the error, for vendor-specific
176+
// Optional vendor-provided diagnostic code for the error, for vendor-specific
177177
// insights or more granular diagnostics.
178-
optional uint32 vendor_error_code = 2;
178+
optional uint32 vendor_diagnostic_code = 2;
179179

180180
// Optional human-readable message providing additional context.
181181
string message = 3;
@@ -189,30 +189,35 @@ message SensorState {
189189
// List of states of the microgrid sensor.
190190
//
191191
// !!! note
192-
// The list will contain unique members. No state will exist twice in
193-
// this list.
192+
// This list is treated as a set, and therefore its members will be unique,
193+
// i.e., no state will exist twice in this list.
194+
//
195+
// !!! note
196+
// If the state is `SENSOR_STATE_CODE_ERROR`, the sensor is in an error
197+
// state. In such cases, the `errors` field will be populated with the
198+
// list of errors.
194199
repeated SensorStateCode states = 2;
195200

196201
// List of warnings for the microgrid sensor.
197202
//
198203
// !!! note
199-
// This list is expected to have warnings if and only if the sensor is
200-
// reporting warnings.
204+
// This list is treated as a set, and therefore its members will be unique,
205+
// i.e., no state will exist twice in this list.
201206
//
202207
// !!! note
203-
// The list will contain unique members. No warning will exist twice in
204-
// this list.
208+
// This list is expected to have warnings if and only if the sensor is
209+
// reporting warnings.
205210
repeated SensorDiagnostic warnings = 3;
206211

207212
// List of errors for the microgrid sensor.
208213
//
209214
// !!! note
210-
// This list is expected to have errors if and only if the sensor is in
211-
// an error state.
215+
// This list is treated as a set, and therefore its members will be unique,
216+
// i.e., no state will exist twice in this list.
212217
//
213218
// !!! note
214-
// The list will contain unique members. No error will exist twice in
215-
// this list.
219+
// This list is expected to have errors if and only if the sensor is in
220+
// an error state.
216221
repeated SensorDiagnostic errors = 4;
217222
}
218223

0 commit comments

Comments
 (0)