Skip to content

Commit 55e2ec9

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 55e2ec9

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-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: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,19 @@ message DispatchFilter {
312312
}
313313

314314
// Parameter for controlling which components a dispatch applies to
315-
// either a set of component IDs, or a set of component categories.
315+
// either a set of component IDs, or a set of component categories (with optional type).
316316
// Examples:
317317
// - To dispatch to a set of component IDs:
318318
// components { component_ids { ids: [1, 2, 3] } }
319319
// - To dispatch to a set of component categories:
320-
// components { component_categories { categories: [COMPONENT_CATEGORY_BATTERY, COMPONENT_CRYPTO_MINER] } }
320+
// components {
321+
// component_categories {
322+
// categories: [
323+
// {category: COMPONENT_CATEGORY_BATTERY, type: BATTERY_TYPE_LI_ION},
324+
// {cateogry: COMPONENT_CRYPTO_MINER}
325+
// ]
326+
// }
327+
// }
321328
message TargetComponents {
322329
// Wrapper for controlling dispatches with a set of component IDs
323330
// Required as we can't use `repeated` directly in a `oneof`
@@ -326,19 +333,42 @@ message TargetComponents {
326333
repeated uint64 ids = 1;
327334
}
328335

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

336366
oneof components {
337367
// Set of component IDs
338368
IdSet component_ids = 1;
339369

340370
// Component categories
341-
CategorySet component_categories = 2;
371+
CategoryTypeSet component_categories = 2;
342372
}
343373
}
344374

0 commit comments

Comments
 (0)