Skip to content

Verbraucher: Bugfixes verknüpfte Zähler - #4073

Merged
LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:consumer_dev
Oct 8, 2026
Merged

LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:consumer_dev

Conversation

@LKuemmel

@LKuemmel LKuemmel commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Bugfixes for #4011

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

Linked-meter filtering can prevent recovery of a missing grid-meter root.

2 open findings
What changed in this PR

Fixes consumer-linked meter handling following #4011, keeping linked meters outside the hierarchy while accounting for their IDs.

Changes:

  • Derives the maximum hierarchy ID from broker topics.
  • Prevents linked consumer meters from being re-added during hierarchy validation.
  • Adds regression tests for both behaviors.
File Description
packages/​helpermodules/​command.py Calculates hierarchy IDs from component topics.
packages/​helpermodules/​command_test.py Tests topic-based ID calculation and updates mocks.
packages/​control/​counter_all/​hierarchy.py Skips linked meters when restoring missing entries.
packages/​control/​counter_all/​hierarchy_test.py Tests that linked meters remain absent.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread packages/control/counter_all/hierarchy.py
Comment thread packages/helpermodules/command.py Outdated

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

Fix the incorrect test argument and rename the misleading regression test.

1 open finding
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Rename test to reflect counter is not re-added

packages/​control/​counter_all/​hierarchy_test.py:407

The test name says the linked counter is re-added, but the assertion intentionally verifies that counter 6 is not added back to the hierarchy. This opposite wording makes the regression test misleading; rename it to describe the non-re-add behavior.

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread packages/helpermodules/command_test.py Outdated
monkeypatch.setattr(command, "ProcessBrokerBranch", ProcessBrokerBranchMock)

command_instance = Command.__new__(Command)
command_instance._get_max_id_hierarchy_by_topics(-1)
@LKuemmel
LKuemmel merged commit cb99577 into openWB:master Oct 8, 2026
1 check passed
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