Repository navigation
Verbraucher: Stecker-Status - #4084
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.