add type for loadmanagement prio, improve update config - #3834
Merged
LKuemmel merged 3 commits intoAug 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (3)
packages/control/counter_all/counter_all_data.py:104
- Im Protocol stimmt die Signatur von
_remove_loadmanagement_prio_itemnicht mit der Implementierung inLoadmanagementPrioMixinüberein: dort wirdentryalsList[Dict]erwartet und einboolzurückgegeben. Das kann Typprüfung/IDE-Unterstützung brechen und verdeckt echte Fehler.
def add_loadmanagement_prio_item(self, type: ComponentType, id: int) -> None: ...
def remove_loadmanagement_prio_item(self, type: ComponentType, id: int) -> None: ...
def _remove_loadmanagement_prio_item(self, type: ComponentType, id: int, entry: Dict) -> None: ...
packages/control/counter_all/loadmanagement_prio_test.py:36
- Kleiner Tippfehler im Test-Case-Label:
emtpy listsollteempty listheißen (hilft beim Lesen von Testreports).
pytest.param([], 2, ComponentType.VEHICLE, [{"type": "vehicle", "id": 2}], id="emtpy list"),
packages/control/counter_all/loadmanagement_prio_test.py:142
- In
test_remove_loadmanagement_prio_itemwird der parametrisiertetypeaktuell ignoriert und hartComponentType.VEHICLEverwendet. Besser ist es, den parametrisierten Wert zu nutzen (und so auch klar zu machen, dass nachtype+identfernt wird).
c.remove_loadmanagement_prio_item(ComponentType.VEHICLE, id)
LKuemmel
force-pushed
the
feature_loadmanagement_prio_list
branch
from
August 21, 2026 07:55
92d9f60 to
f855518
Compare
LKuemmel
force-pushed
the
loadmanagement_prio_list
branch
from
August 21, 2026 12:02
1ec4037 to
4585cd5
Compare
| self.all_received_topics[f"openWB/vehicle/template/charge_template/{charge_template_id}"]) | ||
| if charge_template["chargemode"]["selected"] == chargemode and charge_template["prio"] == prio: | ||
| loadmanagement_prios.append({"type": "vehicle", "id": int(get_index(topic))}) | ||
| grouped_vehicles.append({"type": "vehicle", "id": int(get_index(topic))}) |
LKuemmel
force-pushed
the
loadmanagement_prio_list
branch
from
August 21, 2026 12:17
4585cd5 to
5496a81
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
packages/helpermodules/command.py:797
ComponentType.VEHICLE.valueis"vehicle", which is exactly the value thatremove_loadmanagement_prio_itemhard-coded before this change. Consequently, theremoveVehiclepath is behaviorally identical and can still select the same colliding entry described in the PR. The vehicle and consumer entries need distinct persisted type values, and this call must target the vehicle value after existing data is migrated.
data.data.counter_all_data.remove_loadmanagement_prio_item(ComponentType.VEHICLE, payload["data"]["id"])
packages/control/counter_all/loadmanagement_prio_test.py:142
- The test now ignores its parametrized
typeargument and always removesComponentType.VEHICLE; moreover, every fixture contains only vehicle entries. It therefore cannot exercise the same-ID, different-type collision that this PR is intended to fix. Pass enum values through the parameter and add a mixed-type case asserting that only the requested type is removed.
c.remove_loadmanagement_prio_item(ComponentType.VEHICLE, id)
Comment on lines
+3598
to
+3603
| grouped_vehicles = [] | ||
| self._loop_all_received_topics(upgrade) | ||
| if len(grouped_vehicles) == 1: | ||
| loadmanagement_prios.append(grouped_vehicles[0]) | ||
| elif len(grouped_vehicles) > 1: | ||
| loadmanagement_prios.append({"type": "group", "children": grouped_vehicles}) |
Contributor
Author
There was a problem hiding this comment.
im Feature-Branch nicht relevant
LKuemmel
merged commit Aug 21, 2026
ddfaf21
into
openWB:feature_loadmanagement_prio_list
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wenn ich ein Fahrzeug lösche, wird aus openWB/counter/get/loadmanagement_prios nicht der Eintrag des Fahrzeugs entfernt, sondern der Eintrag eines Verbrauchers – und zwar genau der, der dieselbe ID hat.
Fahrzeuge und Verbraucher vergeben ihre IDs unabhängig voneinander, die Nummernkreise überschneiden sich also.