Kostal Plenticore: add holdcharge implementation#30853
Merged
Merged
Conversation
Contributor
Author
|
@deadrabbit87 fyi |
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="templates/definition/meter/kostal-plenticore-gen2.yaml" line_range="135" />
<code_context>
error: ErrNotAvailable
{{- end }}
+ - case: 4 # holdcharge
+ set:
+ source: const
+ value: 0 # W
</code_context>
<issue_to_address>
**issue (bug_risk):** The nested `set:` key will override the outer `set` mapping, likely breaking the intended behavior.
Using multiple `set:` keys or nesting them incorrectly can cause earlier definitions (like `source: const / value: 0`) to be ignored by YAML/template processors, so the `holdcharge` behavior may not run as intended. Please ensure the modbus write (if needed) is either a separate list item (another `- set:`) or expressed under a different key at the same level, so both operations are handled as expected.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
This implementation adds the holdCharge feature to Kostal Plenticore devices, as introduced in #27906.
It utilizes register 1038 to set a charge power limit (in watts), effectively preventing charging while still allowing discharge if required.
From the Kostal Modbus documentation:
The existing defer logic is used to ensure registers written are properly reset when switching modes.