-
Notifications
You must be signed in to change notification settings - Fork 4
Allow targeting categories with subtypes #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v0.x.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,34 @@ | |
|
||
## Upgrading | ||
|
||
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with --> | ||
* `TargetComponents` was reworked. It now is a type alias for `TargetIds | TargetCategories`: | ||
* `TargetIds` can be used to specify one or more specific target IDs: | ||
* `TargetIds(1, 2, 3)` or | ||
* `TargetIds(ComponentIds(1), ComponentIds(2), ComponentIds(3))` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, but this seems to be fake news, right? This one is not supported yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is specifically supported (if the type can be cast to int)! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is wrong. It should only accept |
||
* `TargetCategories` can be used to specify one or more target categories: | ||
* `TargetCategories(ComponentCategory.BATTERY, ComponentCategory.SOLAR)` | ||
|
||
## New Features | ||
|
||
* `dispatch-cli` supports now the parameter `--type` and `--running` to filter the list of running services by type and status, respectively. | ||
* Every call now has a default timeout of 60 seconds, streams terminate after five minutes. This can be influenced by the two new parameters for`DispatchApiClient.__init__()`: | ||
* `default_timeout: timedelta` (default: 60 seconds) | ||
* `stream_timeout: timedelta` (default: 5 minutes) | ||
* With the new `TargetCategory` class (providing `.category` and `.type`) we can now specify subtypes of the categories: | ||
* `ComponentCategory.BATTERY` uses `BatteryType` with possible values: `LI_ION`, `NA_ION` | ||
* `ComponentCategory.INVERTER` uses `InverterType` with possible values: `BATTERY`, `SOLAR`, `HYBRID` | ||
* `ComponentCategory.EV_CHARGER` uses `EvChargerType`: with possible values `AC`, `DC`, `HYBRID` | ||
* A few examples on how to use the new `TargetCategory`: | ||
* `TargetCategory(BatteryType.LI_ION)` | ||
* `category` is `ComponentCategory.BATTERY` | ||
* `type` is `BatteryType.LI_ION` | ||
* `TargetCategory(ComponentCategory.BATTERY)` | ||
* `category` is `ComponentCategory.BATTERY` | ||
* `type` is `None` | ||
* `TargetCategories(InverterType.SOLAR)` | ||
* `category` is `ComponentCategory.INVERTER` | ||
* `type` is `InverterType.SOLAR` | ||
|
||
|
||
## Bug Fixes | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless we have some other situation like the one @ela-kotulska-frequenz mentioned and we want this only as a transitional step, I wouldn't allow raw
int
s, the whole point of introducingComponentId
is that you can't accidentally pass some randomint
(or some ID for other class of object) where a specific ID is required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, we're not introducing it in this PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see, so we can keep the conversion to
int
until this repo starts usingComponentId
(when it is added toclient-common
. Then we only acceptComponentId
.