Skip to content

Commit a4937f9

Browse files
authored
Fix doc examples for SensorData and ComponentData (#150)
`SensorData` docs currently reflect components/`ComponentData`, and `ComponentData` states were missing `warnings` field contained in just `ComponentState`. PR corrects contained examples in documentation, they now correctly reflect their respective components.
2 parents 59dcba8 + 90c873b commit a4937f9

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ dependencies and run `pytest` manually.
8888
python -m pip install .[dev-pytest] # included in .[dev] too
8989

9090
# And for example
91-
pytest tests/test_*.py
91+
pytest pytests/test_*.py
9292
```
9393

9494
Or you can use `nox`:

RELEASE_NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Frequenz Common API Release Notes
22

33
## Summary
4+
This release:
5+
* Corrects `SensorData` and `ComponentData` doc examples
6+
to correctly reflect differences in respective values.
47

5-
<!-- Here goes a general summary of what this release is about -->
68

79
## Upgrading
810

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,13 @@ message ComponentConnection {
208208
// {
209209
// sampled_at: "2023-10-01T00:00:00Z",
210210
// states: [],
211+
// warnings: [],
211212
// errors: [],
212213
// },
213214
// {
214215
// sampled_at: "2023-10-01T00:00:00Z",
215216
// states: [],
217+
// warnings: [],
216218
// errors: [],
217219
// },
218220
// ]

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,35 @@ enum SensorMetric {
107107
SENSOR_METRIC_DEW_POINT = 8;
108108
}
109109

110-
// ComponentData message aggregates multiple metrics, operational states, and
111-
// errors, related to a specific microgrid component.
110+
// SensorData message aggregates multiple metrics, operational states, and
111+
// errors, related to a specific microgrid sensor.
112112
//
113113
// !!! example
114114
// Example output of a component data message:
115115
// ```
116116
// {
117-
// component_id: 13,
117+
// sensor_id: 13,
118118
// metric_samples: [
119119
// /* list of metrics for multiple timestamps */
120120
// {
121121
// sampled_at: "2023-10-01T00:00:00Z",
122122
// metric: "METRIC_SENSOR_TEMPERATURE",
123123
// sample: metric_sample_type: {simple_metric: {value: 23.5},
124-
// bounds: {},
125124
// },
126125
// {
127126
// sampled_at: "2023-10-01T00:00:00Z",
128127
// metric: "METRIC_SENSOR_RELATIVE_HUMIDITY",
129128
// sample: metric_sample_type: {simple_metric: {value: 23.5},
130-
// bounds: {},
131129
// }
130+
// ],
131+
// states: [
132+
// {
133+
// sampled_at: "2023-10-01T00:00:00Z",
134+
// states: [],
135+
// errors: [],
136+
// },
132137
// ]
138+
//
133139
// }
134140
// ```
135141
message SensorData {

0 commit comments

Comments
 (0)