Skip to content

Commit 3ed7e83

Browse files
Update protobuf file headers (#47)
2 parents 6c000e4 + d104333 commit 3ed7e83

File tree

4 files changed

+10
-64
lines changed

4 files changed

+10
-64
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,16 @@
22

33
## Summary
44

5-
This release includes renaming the `EVChargerType` enum to `EvChargerType` and
6-
the addition of the `MetricAggregation` message.
5+
<!-- Here goes a general summary of what this release is about -->
76

87
## Upgrading
98

10-
* The submodule URL was changed to use HTTPS instead of SSH (to avoid problems trying to unlock SSH keys to do updates, etc.).
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1110

12-
Make sure you sync your submodules to the new URL:
13-
14-
```console
15-
$ git submodule sync
16-
Synchronizing submodule url for 'submodules/api-common-protos'
17-
```
18-
19-
* [`EVChargerType` enum refactored](https://github.com/frequenz-floss/frequenz-api-common/pull/21)
20-
21-
The enum with the oder variants was compiled into the following rust enum
22-
(by prost):
23-
```rust
24-
pub enum EvChargerType {
25-
/// Default type.
26-
EvchargerTypeUnspecified = 0,
27-
/// The EV charging station supports AC charging only.
28-
EvchargerTypeAc = 1,
29-
/// The EV charging station supports DC charging only.
30-
EvchargerTypeDc = 2,
31-
/// The EV charging station supports both AC and DC.
32-
EvchargerTypeHybrid = 3,
33-
}
34-
```
35-
Here the enum variants were unnecessarily prefixed with `EvchargerType`.
36-
This lead to accessing the enum variants in a very verbose manner, e.g.,
37-
`EvChargerType::EvchargerTypeHybrid`.
38-
39-
The changed version of the enum in this commit results in the following
40-
rust enum:
41-
```rust
42-
pub enum EvChargerType {
43-
/// Default type.
44-
Unspecified = 0,
45-
/// The EV charging station supports AC charging only.
46-
Ac = 1,
47-
/// The EV charging station supports DC charging only.
48-
Dc = 2,
49-
/// The EV charging station supports both AC and DC.
50-
Hybrid = 3,
51-
}
52-
```
53-
Here the unnecessary prefix `EvchargerType` is absent. This reduces the
54-
verbosity while accessing the enum variants, making the resulting rust code
55-
more readable, e.g., as `EvChargerType::Hybrid`.
56-
57-
This change also leads to renaming the enum from `EVChargerType` to
58-
`EvChargerType`, to satisfy protolint requirements.
5911
## New Features
6012

61-
* [Added `MetricAggregation` message](https://github.com/frequenz-floss/frequenz-api-common/pull/22)
62-
63-
The message `MetricAggregation` has been [copied from frequenz-api-microgrid](https://github.com/frequenz-floss/frequenz-api-microgrid/blob/2b316db3d34565fa04445be62700176d07756750/proto/frequenz/api/microgrid/common.proto#L15-L99)
64-
into this repository, so that it can be used by other APIs as well.
13+
<!-- Here goes the main new features and examples or instructions on how to use them -->
6514

6615
## Bug Fixes
6716

68-
None
17+
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

proto/frequenz/api/common/components.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Frequenz microgrid components definitions.
22
//
3-
// Copyright:
43
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
54
//
6-
// License:
7-
// MIT
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
87

98
syntax = "proto3";
109

proto/frequenz/api/common/metrics.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Metrics & bounds definitions.
22
//
3-
// Copyright:
43
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
54
//
6-
// License:
7-
// MIT
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
87

98
syntax = "proto3";
109

proto/frequenz/api/common/metrics/electrical.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Contains definitions for electrical metrics (AC and DC).
22
//
3-
// Copyright:
43
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
54
//
6-
// License:
7-
// MIT
5+
// Licensed under the MIT License (the "License");
6+
// you may not use this file except in compliance with the License.
87

98
syntax = "proto3";
109

0 commit comments

Comments
 (0)