Skip to content

Commit 822c9e7

Browse files
committed
Add a way to target specific battery, inverter and EV charger types
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent c56b3a2 commit 822c9e7

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
* The `TargetComponents` message now accepts an optional `type` too. `.components.component_categories` is no longer just a `ComponentCategory` but a new `CategoryAndType` message that has a required `category` (`ComponentCategory`) and an optional `type` (`oneof BatteryType, EVChargerType, InverterType`).
1010

1111
## New Features
1212

13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
13+
- Now specific types of batteries, inverters and EV chargers can be targeted.
1414

1515
## Bug Fixes
1616

proto/frequenz/api/dispatch/v1/dispatch.proto

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import "google/protobuf/struct.proto";
1818
import "google/protobuf/timestamp.proto";
1919

2020
import "frequenz/api/common/v1/microgrid/components/components.proto";
21+
import "frequenz/api/common/v1/microgrid/components/battery.proto";
22+
import "frequenz/api/common/v1/microgrid/components/ev_charger.proto";
23+
import "frequenz/api/common/v1/microgrid/components/inverter.proto";
2124
import "frequenz/api/common/v1/pagination/pagination_info.proto";
2225
import "frequenz/api/common/v1/pagination/pagination_params.proto";
2326

@@ -312,12 +315,19 @@ message DispatchFilter {
312315
}
313316

314317
// Parameter for controlling which components a dispatch applies to
315-
// either a set of component IDs, or a set of component categories.
318+
// either a set of component IDs, or a set of component categories (with optional type).
316319
// Examples:
317320
// - To dispatch to a set of component IDs:
318321
// components { component_ids { ids: [1, 2, 3] } }
319322
// - To dispatch to a set of component categories:
320-
// components { component_categories { categories: [COMPONENT_CATEGORY_BATTERY, COMPONENT_CRYPTO_MINER] } }
323+
// components {
324+
// component_categories {
325+
// categories: [
326+
// {category: COMPONENT_CATEGORY_BATTERY, type: BATTERY_TYPE_LI_ION},
327+
// {cateogry: COMPONENT_CRYPTO_MINER}
328+
// ]
329+
// }
330+
// }
321331
message TargetComponents {
322332
// Wrapper for controlling dispatches with a set of component IDs
323333
// Required as we can't use `repeated` directly in a `oneof`
@@ -326,19 +336,42 @@ message TargetComponents {
326336
repeated uint64 ids = 1;
327337
}
328338

329-
// Wrapper for controlling dispatches with a set of component categories
339+
// Wrapper for controlling dispatches with a set of component categories and optional types
330340
// Required as we can't use `repeated` directly in a `oneof`
331-
message CategorySet {
341+
message CategoryTypeSet {
332342
// Set of component categories
333-
repeated frequenz.api.common.v1.microgrid.components.ComponentCategory categories = 1;
343+
repeated CategoryAndType categories = 1;
344+
}
345+
346+
// A tuple of a (required) category and an (optional) type
347+
// If a type is specified, it must be a valid type for the given category and
348+
// only components of that type will be targeted.
349+
message CategoryAndType {
350+
// The category of the target component (required)
351+
frequenz.api.common.v1.microgrid.components.ComponentCategory category = 1;
352+
353+
// The type of the target component (optional)
354+
oneof type {
355+
// The type of battery
356+
// Only applicable if the category is COMPONENT_CATEGORY_BATTERY
357+
frequenz.api.common.v1.microgrid.components.BatteryType battery = 2;
358+
359+
// The type of solar array
360+
// Only applicable if the category is COMPONENT_CATEGORY_INVERTER
361+
frequenz.api.common.v1.microgrid.components.InverterType inverter = 3;
362+
363+
// The type of EV charger
364+
// Only applicable if the category is COMPONENT_CATEGORY_EV_CHARGER
365+
frequenz.api.common.v1.microgrid.components.EvChargerType ev_charger = 4;
366+
}
334367
}
335368

336369
oneof components {
337370
// Set of component IDs
338371
IdSet component_ids = 1;
339372

340373
// Component categories
341-
CategorySet component_categories = 2;
374+
CategoryTypeSet component_categories = 2;
342375
}
343376
}
344377

0 commit comments

Comments
 (0)