Skip to content

Commit

Permalink
Upgrade frequenz-api-common to v0.3.0 (#65)
Browse files Browse the repository at this point in the history
The submodule `frequenz-api-common` has been upgraded to v0.3.0.
This version renames the enum representing EV charger types to
`EvChargerType` and defined the `MetricAggregation` message, which was
previously defined in `frequenz-api-microgrid`.

Since the message `MetricAggregation` is now being imported from the
common specs, it has been removed from the file `common.proto`.

The message `EVCharger` is being renamed to `EvCharger`, to use same
naming convention as `frequenz-api-common`.
Note that a similar renaming was done in [`frequenz-api-common`
v0.3.0](frequenz-floss/frequenz-api-common#21)
to improve the code quality of the derived rust code using prost.
  • Loading branch information
tiyash-basu-frequenz authored Jun 6, 2023
2 parents b6ac10c + bc07384 commit c20fa34
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 100 deletions.
24 changes: 20 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,32 @@

## Summary

<!-- Here goes a general summary of what this release is about -->
This release upgrades the submodule `frequenz-api-common` to v0.3.0, and
renames the message `EVCharger` to `EvCharger`.

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including if there are any deprecations and what they should be replaced with -->
* [Upgraded `frequenz-api-common` to v0.3.0](https://github.com/frequenz-floss/frequenz-api-microgrid/pull/65)

The submodule `frequenz-api-common` has been upgraded to v0.3.0.
This version renames the enum representing EV charger types to `EvChargerType`
and defined the `MetricAggregation` message, which was previously defined in
`frequenz-api-microgrid`.

Since the message `MetricAggregation` is now being imported from the common
specs, it has been removed from the file `common.proto`.

* [Renamed message `EVCharger` to `EvCharger`](https://github.com/frequenz-floss/frequenz-api-microgrid/pull/65)

This is done to use same naming convention as `frequenz-api-common`.
Note that a similar renaming was done in `frequenz-api-common` v0.3.0 to
improve the code quality of the derived rust code using prost.


## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
None

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
None
7 changes: 4 additions & 3 deletions proto/frequenz/api/microgrid/battery.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package frequenz.api.microgrid.battery;
import "frequenz/api/microgrid/common.proto";

import "frequenz/api/common/components.proto";
import "frequenz/api/common/metrics.proto";
import "frequenz/api/common/metrics/electrical.proto";

// The battery metadata.
Expand Down Expand Up @@ -178,15 +179,15 @@ message Data {

// Battery's overall SoC.
// In percent (%).
common.MetricAggregation soc = 2;
frequenz.api.common.metrics.MetricAggregation soc = 2;

// The aggregated values of all the temperature measurements of a battery.
// In degree Celsius (°C).
common.MetricAggregation temperature = 3;
frequenz.api.common.metrics.MetricAggregation temperature = 3;

// The aggregated values of all the humidity measurements of a battery.
// In percent (%).
common.MetricAggregation humidity = 4;
frequenz.api.common.metrics.MetricAggregation humidity = 4;
}

// Battery properties.
Expand Down
88 changes: 0 additions & 88 deletions proto/frequenz/api/microgrid/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,94 +10,6 @@ syntax = "proto3";

package frequenz.api.microgrid.common;

import "frequenz/api/common/metrics.proto";

// Metrics depicted as a collection of statistical summaries.
//
// Useful when a component has to report multiple values for the same metric.
// E.g., a battery is a collection of several blocks, and each block has a
// temperature sensor. The battery can report a summary of the values provided
// by all these sensors, like, min, max, avg, etc., and if possible, the entire
// array of temperature values.
message MetricAggregation {
// The average value of the metric.
float avg = 1;

// The minimum value of the metric.
optional float min = 2;

// The maximum value of the metric.
optional float max = 3;

// The array of all the metric values.
repeated float raw_values = 12;

// The manufacturer's rated bounds of the metric. This may differ from
// `system_bounds` as it does not take into account the current state of the
// overall system.
frequenz.api.common.metrics.Bounds rated_bounds = 13;

// The current bounds of the metric, as imposed by the component this metric
// originates from.
frequenz.api.common.metrics.Bounds component_bounds = 14;

// These bounds indicate the range of values that are disallowed for the
// metric.
// If these bounds for a metric are [`lower`, `upper`], then this metric's
// `value` needs to comply with the constraints
// `value <= lower` OR `upper <= value`.
//
// It is important to note that these bounds work together with
// `system_inclusion_bounds`.
//
// E.g., for the system to accept a charge command,
// clients need to request power values within the bounds
// `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
// This means that clients can only request charge commands with power values
// that are within the `system_inclusion_bounds`, but not within
// `system_exclusion_bounds`.
// Similarly, for the system to accept a discharge command,
// clients need to request power values within the bounds
// `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.
//
// The following diagram illustrates the relationship between the bounds.
// ```
// inclusion.lower inclusion.upper
// <-------|============|------------------|============|--------->
// exclusion.lower exclusion.upper
// ```
// ---- values here are disallowed and wil be rejected
// ==== vales here are allowed and will be accepted
frequenz.api.common.metrics.Bounds system_exclusion_bounds = 4;

// These bounds indicate the range of values that are allowed for the metric.
// If these bounds for a metric are [`lower`, `upper`], then this metric's
// `value` needs to comply with the constraint `lower <= value <= upper`
//
// It is important to note that these bounds work together with
// `system_exclusion_bounds`.
//
// E.g., for the system to accept a charge command,
// clients need to request power values within the bounds
// `[system_inclusion_bounds.lower, system_exclusion_bounds.lower]`.
// This means that clients can only request charge commands with power values
// that are within the `system_inclusion_bounds`, but not within
// `system_exclusion_bounds`.
// Similarly, for the system to accept a discharge command,
// clients need to request power values within the bounds
// `[system_exclusion_bounds.upper, system_inclusion_bounds.upper]`.
//
// The following diagram illustrates the relationship between the bounds.
// ```
// inclusion.lower inclusion.upper
// <-------|============|------------------|============|--------->
// exclusion.lower exclusion.upper
// ```
// ---- values here are disallowed and wil be rejected
// ==== vales here are allowed and will be accepted
frequenz.api.common.metrics.Bounds system_inclusion_bounds = 5;
}

// Error levels definitions.
enum ErrorLevel {
// Unspecified component error.
Expand Down
6 changes: 3 additions & 3 deletions proto/frequenz/api/microgrid/ev_charger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import "frequenz/api/common/metrics/electrical.proto";
// The EV charger metadata.
message Metadata {
// The EV charger type.
frequenz.api.common.components.EVChargerType type = 1;
frequenz.api.common.components.EvChargerType type = 1;
}

// The possible states of an EV charging station.
Expand Down Expand Up @@ -186,8 +186,8 @@ message Properties {
string firmware_ver = 1;
}

// EVCharger details
message EVCharger {
// EvCharger details
message EvCharger {
// The component properties
Properties properties = 1;

Expand Down
2 changes: 1 addition & 1 deletion proto/frequenz/api/microgrid/microgrid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ message ComponentData {
meter.Meter meter = 3;
inverter.Inverter inverter = 4;
battery.Battery battery = 5;
ev_charger.EVCharger ev_charger = 6;
ev_charger.EvCharger ev_charger = 6;
sensor.Sensor sensor = 7;
}
}
Expand Down

0 comments on commit c20fa34

Please sign in to comment.