Skip to content

Verbraucher: Ist-Strom = Soll-Strom, wenn Intervall für Schaltbefehl nicht abgelaufen - #4121

Merged
LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:fixes
Oct 16, 2026
Merged

LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:fixes

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

@LKuemmel LKuemmel added this to the 2.3.0 milestone Oct 15, 2026
@LKuemmel
LKuemmel marked this pull request as ready for review October 16, 2026 09:45
@LKuemmel
LKuemmel requested a balanced review from Copilot October 16, 2026 09:45

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

Reusing allocation maximums as consumer demand can corrupt surplus accounting and incorrectly cancel pending shutdowns.

1 open finding
What changed in this PR

This PR adjusts consumer switching-interval handling in load control.

Changes:

  • Preserves consumer demand during switching intervals.
  • Uses interval eligibility for consumer filtering and maximum-demand allocation.
  • Updates test setup for eligible consumers.
File Description
packages/​control/​consumer/​consumer.py Retains demand during switching intervals.
packages/​control/​algorithm/​surplus_controlled.py Gates consumer maximum-demand allocation by interval.
packages/​control/​algorithm/​integration_test/​pv_charging_test.py Updates PV consumer setup.
packages/​control/​algorithm/​integration_test/​instant_charging_test.py Updates instant-charging consumer setup.
packages/​control/​algorithm/​filter_chargepoints.py Filters consumers by interval eligibility.
packages/​control/​algorithm/​filter_chargepoints_test.py Sets interval eligibility in the existing test.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/control/consumer/consumer.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

Address the missing consumer gating tests, returned-current coverage, and voltage fallback for consumer current calculation.

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

In code that hasn't changed since last review

Medium severity Add tests for consumer filtering with elapsed and blocked intervals

packages/​control/​algorithm/​filter_chargepoints.py:67

The new consumer-specific filtering behavior is not covered by the updated test: it only sets switch_interval_elapsed = True, so the prior regression case (a consumer with a nonzero/stale required_current while the interval is still blocked) remains untested. Add assertions for both elapsed and non-elapsed consumers so this gating condition cannot regress.

🧠 Review effort: Lite

Comment on lines +126 to 129
return (max(self.data.get.currents),
None,
self.data.control_parameter.chargemode,
self.data.control_parameter.submode)
@LKuemmel LKuemmel changed the title fix consumer Verbraucher: Ist-Strom = Soll-Strom, wenn Intervall für Schaltbefehl nicht abgelaufen Oct 16, 2026
@LKuemmel
LKuemmel merged commit e6ac577 into openWB:master Oct 16, 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