Repository navigation
Consumer fixes: wait_for_start_active default, fix reset reserved surplus - #3960
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The reset path must release the exact surplus amount reserved for the load.
Pull request overview
Updates consumer startup defaults and surplus reservation cleanup during switch delays.
Changes:
- Disables
wait_for_start_activeby default. - Adds regression tests for delay-state reset behavior.
- Corrects surplus release to use the exact reserved amount.
File summaries
| File | Summary |
|---|---|
packages/control/counter.py |
Updates delay-state surplus reservation cleanup. |
packages/control/counter_test.py |
Adds reset behavior regression tests. |
packages/control/consumer/consumer_data.py |
Changes the consumer startup default. |
Review details
Suppressed comments (1)
packages/control/counter.py:607
- For
SWITCH_OFF_DELAY,released_surpluswas incremented byload.data.set.required_powerwhen the delay started (inswitch_off_check_threshold), but this reset path subtractsvehicle.switch_on_threshold * phasesinstead. For a typical chargepoint these values differ substantially (for example, 16 A × 3 phases is 11,040 W versus a 1,500 W threshold × 3 = 4,500 W), so changing mode during the delay leaves stale released surplus and reduces the surplus available to other loads. Release the exact amount reserved for this load (preserving it beforeChargepoint.updateoverwritesrequired_power) rather than recomputing it from the switch-on threshold.
if state == ChargepointState.SWITCH_ON_DELAY:
threshold = surplus_config.vehicle.switch_on_threshold * load.data.set.phases_to_use
else:
threshold = surplus_config.vehicle.switch_on_threshold * load.data.control_parameter.phases
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
references #3908 (comment), #3908 (reply in thread)