Skip to content

Verbraucher: Fix verknüpfte Zähler nicht löschbar und in Hierarchie-Validierung berücksichtigen - #4175

Merged
LKuemmel merged 5 commits into
openWB:masterfrom
LKuemmel:consumer_dev
Oct 23, 2026
Merged

LKuemmel merged 5 commits into
openWB:masterfrom
LKuemmel:consumer_dev

Conversation

@LKuemmel

Copy link
Copy Markdown
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

@LKuemmel LKuemmel added this to the 2.3.0 milestone Oct 23, 2026
@LKuemmel
LKuemmel requested a lite review from Copilot October 23, 2026 08:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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"])
Comment thread packages/helpermodules/command.py Outdated
LKuemmel and others added 2 commits October 23, 2026 11:41
… when removing linked counters'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@LKuemmel
LKuemmel merged commit 809ac74 into openWB:master Oct 23, 2026
1 check passed
@LKuemmel
LKuemmel deleted the consumer_dev branch October 23, 2026 09:53
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants