Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions proto/frequenz/api/dispatch/v1/dispatch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

import "frequenz/api/common/v1/microgrid/components/battery.proto";
import "frequenz/api/common/v1/microgrid/components/components.proto";
import "frequenz/api/common/v1/microgrid/components/ev_charger.proto";
import "frequenz/api/common/v1/microgrid/components/inverter.proto";
import "frequenz/api/common/v1/microgrid/electrical_components/battery.proto";
import "frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto";
import "frequenz/api/common/v1/microgrid/electrical_components/ev_charger.proto";
import "frequenz/api/common/v1/microgrid/electrical_components/inverter.proto";
import "frequenz/api/common/v1/pagination/pagination_info.proto";
import "frequenz/api/common/v1/pagination/pagination_params.proto";
import "frequenz/api/common/v1/types/time_interval_filter.proto";

// Service providing operations related to dispatching microgrid components.
//
Expand Down Expand Up @@ -204,15 +205,6 @@ message DispatchMetadata {
google.protobuf.Timestamp end_time = 4;
}

// Filter parameter for specifying multiple time intervals
message TimeIntervalFilter {
// Filter by time >= this UTC time.
google.protobuf.Timestamp from_time = 1;

// Filter by time <= this UTC time.
google.protobuf.Timestamp to_time = 2;
}

// Parameters for filtering the dispatch list
message DispatchFilter {
// Recurrence filters
Expand Down Expand Up @@ -304,14 +296,14 @@ message DispatchFilter {

// Optional filter by start time.
// If no interval is provided, all dispatches will be returned.
TimeIntervalFilter start_time_interval = 6;
frequenz.api.common.v1.types.TimeIntervalFilter start_time_interval = 6;

// Optional filter by end time
// Filter dispatches based on their explicit end time.
TimeIntervalFilter end_time_interval = 7;
frequenz.api.common.v1.types.TimeIntervalFilter end_time_interval = 7;

// Optional filter by update time
TimeIntervalFilter update_time_interval = 8;
frequenz.api.common.v1.types.TimeIntervalFilter update_time_interval = 8;
}

// Parameter for controlling which components a dispatch applies to
Expand Down Expand Up @@ -340,7 +332,7 @@ message TargetComponents {
// Deprecated: Use `CategoryTypeSet` instead
message CategorySet {
// Set of component categories
repeated frequenz.api.common.v1.microgrid.components.ComponentCategory categories = 1;
repeated frequenz.api.common.v1.microgrid.electrical_components.ElectricalComponentCategory categories = 1;
}

// Wrapper for controlling dispatches with a set of component categories and optional types
Expand All @@ -355,21 +347,21 @@ message TargetComponents {
// only components of that type will be targeted.
message CategoryAndType {
// The category of the target component (required)
frequenz.api.common.v1.microgrid.components.ComponentCategory category = 1;
frequenz.api.common.v1.microgrid.electrical_components.ElectricalComponentCategory category = 1;

// The type of the target component (optional)
oneof type {
// The type of battery
// Only applicable if the category is COMPONENT_CATEGORY_BATTERY
frequenz.api.common.v1.microgrid.components.BatteryType battery = 2;
frequenz.api.common.v1.microgrid.electrical_components.BatteryType battery = 2;

// The type of solar array
// Only applicable if the category is COMPONENT_CATEGORY_INVERTER
frequenz.api.common.v1.microgrid.components.InverterType inverter = 3;
frequenz.api.common.v1.microgrid.electrical_components.InverterType inverter = 3;

// The type of EV charger
// Only applicable if the category is COMPONENT_CATEGORY_EV_CHARGER
frequenz.api.common.v1.microgrid.components.EvChargerType ev_charger = 4;
frequenz.api.common.v1.microgrid.electrical_components.EvChargerType ev_charger = 4;
}
}

Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires = [
# sure the code is generated using the minimum supported versions, as older
# versions can't work with code that was generated with newer versions.
# https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards
"protobuf == 5.29.4",
"protobuf == 5.29.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis is to match the common api version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. I wonder if there is a better way to do this, it kind of sucks to have such a strong interdependence...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, if this is about the protobuf message about runtime and build version mismatch, using different point releases of the same minor should work. Are you sure this is really needed?

"grpcio-tools == 1.70.0",
"grpcio == 1.70.0",
]
Expand Down Expand Up @@ -43,7 +43,8 @@ classifiers = [
]
requires-python = ">= 3.11, < 4"
dependencies = [
"frequenz-api-common >= 0.5.4, < 0.7",
# "frequenz-api-common >= 0.5.4, < 0.7",
"frequenz-api-common @ git+http://[email protected]/frequenz-floss/[email protected]",
"googleapis-common-protos >= 1.65.0, < 2",
# We can't widen beyond the current value unless we bump the minimum
# requirements too because of protobuf cross-version runtime guarantees:
Expand Down Expand Up @@ -90,7 +91,7 @@ dev-mypy = [
]
dev-noxfile = ["nox == 2025.5.1", "frequenz-repo-config[api] == 0.13.3"]
dev-pylint = [
"pylint == 3.3.6",
"pylint == 3.3.7",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-dispatch[dev-mkdocs,dev-noxfile,dev-pytest]",
]
Expand Down
2 changes: 1 addition & 1 deletion submodules/frequenz-api-common
Submodule frequenz-api-common updated 27 files
+40 −30 .github/dependabot.yml
+81 −0 .github/workflows/ci-pr.yaml
+164 −125 .github/workflows/ci.yaml
+1 −1 MANIFEST.in
+18 −6 RELEASE_NOTES.md
+6 −6 proto/frequenz/api/common/v1/market/energy.proto
+30 −0 proto/frequenz/api/common/v1/market/power.proto
+127 −0 proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto
+0 −493 proto/frequenz/api/common/v1/microgrid/components/components.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/battery.proto
+523 −0 proto/frequenz/api/common/v1/microgrid/electrical_components/electrical_components.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/ev_charger.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/fuse.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/grid.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/inverter.proto
+1 −1 proto/frequenz/api/common/v1/microgrid/electrical_components/transformer.proto
+16 −3 proto/frequenz/api/common/v1/microgrid/lifetime.proto
+9 −0 proto/frequenz/api/common/v1/microgrid/microgrid.proto
+50 −6 proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto
+26 −0 proto/frequenz/api/common/v1/streaming/event.proto
+35 −0 proto/frequenz/api/common/v1/types/time_interval_filter.proto
+0 −0 py/frequenz/api/common/conftest.py
+0 −0 py/frequenz/api/common/v1/microgrid/communication_components/__init__.py
+0 −0 py/frequenz/api/common/v1/microgrid/electrical_components/__init__.py
+4 −0 py/frequenz/api/common/v1/streaming/__init__.py
+35 −18 pyproject.toml
+47 −19 pytests/test_common.py
Loading