Repository navigation
Verbraucher: Fix verknüpfte Zähler nicht löschbar und in Hierarchie-Validierung berücksichtigen - #4175
Merged
Conversation
LKuemmel
commented
Oct 23, 2026
Contributor
- Verknüpfte Zähler können nicht mehr gelöscht werden
- Existenzprüfung beim Wechsel oder Entfernen der Zählerzuordnung
- in Hierarchie enthaltene mit Verbrauchern verknüpfte Zähler entfernt
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues could remove the EVU root counter, raise errors when module configuration is missing, or incorrectly restore a shared counter.
2 open issues
What changed in this PR
This pull request prevents deletion of counters linked to consumers, validates extra-meter assignments, and excludes linked counters from hierarchy validation.
Changes:
- Block deletion of counters assigned to consumers.
- Validate counter existence when changing or removing extra-meter assignments.
- Update hierarchy validation and related tests and interfaces.
| File | Summary |
|---|---|
packages/helpermodules/subdata.py |
Handles existing and missing previous extra-meter configurations during assignment changes. |
packages/helpermodules/subdata_test.py |
Tests extra-meter removal and switching scenarios. |
packages/helpermodules/command.py |
Prevents deletion of counters linked to consumers. |
packages/helpermodules/command_test.py |
Tests linked-counter deletion prevention for components and devices. |
packages/control/counter_all/hierarchy.py |
Removes linked extra-meter counters from hierarchy validation. |
packages/control/counter_all/hierarchy_test.py |
Tests hierarchy cleanup and linked-counter handling. |
packages/control/counter_all/counter_all_data.py |
Updates hierarchy protocol method signatures. |
Review effort: Lite
Comment on lines
+362
to
+363
| elif type_name == ComponentType.COUNTER and element["id"] in linked_extra_meter_counter_ids: | ||
| self.hierarchy_remove_item(element["id"]) |
… when removing linked counters' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
LKuemmel
added a commit
that referenced
this pull request
Oct 23, 2026
…alidierung berücksichtigen (#4175) * Verknüpfte Zähler können nicht mehr gelöscht werden * Existenzprüfung beim Wechsel oder Entfernen der Zählerzuordnung * in Hierarchie enthaltene mit Verbrauchern verknüpfte Zähler entfernt * Potential fix for pull request finding 'Avoid None module dereference when removing linked counters' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * flake8 --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

