Skip to content

Fix Minimal-Strom bei An/Aus-Geräten, Standby-Threshold für An/Aus-Verbraucher - #4046

Merged
LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:loadmanagement_prio_list
Oct 2, 2026
Merged

LKuemmel merged 4 commits into
openWB:masterfrom
LKuemmel:loadmanagement_prio_list

Conversation

@LKuemmel

@LKuemmel LKuemmel commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Für Geräte, die nur an/aus geschaltet werden können, wird als minimaler Strom für die Regelung der konfigurierte Maximal-Strom verwendet, wenn der Verbraucher nicht in Betrieb ist. Wenn dieser in Betrieb ist, wird der aktuelle Strom verwendet. In der Regelung sind Minimal- und Maximal-Strom gleich.
Als Standby-Threshold in der Anlauferkennung wird für An/Aus-Verbraucher 35 W pro Phase gesetzt. Für stufenlos regelbare Verbraucher wird der Mindeststrom verwendet.

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.

Copilot review overview

🟡 Changes recommended

Fix the five-value return in consumer.py so all branches match the four-value unpacking contract.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates minimum-current handling for on/off consumers based on runtime state.

Changes:

  • Adds an ON_OFF usage grouping.
  • Centralizes runtime-aware minimum-current calculation.
  • Adds parameterized tests for minimum-current behavior.
File Summary
packages/​control/​consumer/​usage.py Defines the on/off usage group.
packages/​control/​consumer/​consumer.py Applies dynamic minimum-current logic; one branch still returns five values instead of four, causing ValueError during updates.
packages/​control/​consumer/​consumer_test.py Tests minimum-current behavior.

💡 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
@LKuemmel LKuemmel changed the title Fix Minimal-Strom bei An/Aus-Geräten in control_parameter Fix Minimal-Strom bei An/Aus-Geräten, Standby-Threshold für An/Aus-Verbraucher Oct 2, 2026
@LKuemmel
LKuemmel requested a lite review from Copilot October 2, 2026 10:52

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.

Copilot review overview

🟡 Changes recommended

Standby classification and low-current handling remain incorrect for on/off consumers.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment on lines +82 to +85
if self.data.get.charge_state:
return get_medium_charging_current(self.data.get.currents)
else:
return self._convert_power_to_current(self.data.config.max_power)
@LKuemmel
LKuemmel merged commit f7a6ffc into openWB:master Oct 2, 2026
1 check passed
@LKuemmel
LKuemmel deleted the loadmanagement_prio_list branch October 2, 2026 12:33
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