Skip to content

Verbraucher: Stecker-Status - #4084

Merged
LKuemmel merged 2 commits into
masterfrom
feature_consumer_plug_state
Oct 12, 2026
Merged

LKuemmel merged 2 commits into
masterfrom
feature_consumer_plug_state

Conversation

@LKuemmel

@LKuemmel LKuemmel commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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

Test coverage and public API wiring for plug_state remain unresolved.

1 open finding
What changed in this PR

Adds consumer charge/plug status handling, validation, and MQTT publication.

Changes:

  • Registers and validates consumer status topics.
  • Derives plug state during control processing.
  • Adds status fields and topic metadata.
File Changes Findings
packages/​helpermodules/​update_config.py Registers consumer status topics. None
packages/​helpermodules/​setdata.py Validates boolean status values. None
packages/​control/​process.py Updates plug state each cycle. None
packages/​control/​consumer/​consumer.py Implements plug-state derivation. Moderate: Add parameterized coverage for controlled and uncontrolled consumer states.
packages/​control/​consumer/​consumer_data.py Adds status fields and topic metadata. Moderate: Expose plug_state through the public consumer API or explicitly limit it to MQTT.

🧠 Review effort: Lite


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

Comment on lines +530 to +537
def set_plug_state(self):
if self.data.usage.type in NOT_CONTROLLED:
if self.data.get.power == 0:
self.data.get.plug_state = False
else:
self.data.get.plug_state = True
else:
self.data.get.plug_state = self.data.set.current > 0

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.

🟢 Approval recommended

No unresolved review issues were identified.

1 open finding

🧠 Review effort: Lite

@LKuemmel
LKuemmel merged commit 109ac19 into master Oct 12, 2026
2 checks passed
@LKuemmel
LKuemmel deleted the feature_consumer_plug_state branch October 12, 2026 07:52
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