EEBus: apply §14a/LPC dimming to OHPCF heat pump#31346
Closed
andig wants to merge 1 commit into
Closed
Conversation
Implement api.Dimmer on the OHPCF charger so an active EnWG §14a / LPC consumption limit pauses or aborts the optional compressor consumption and releases it again. Dim overrides the on/off intent in the control gate. Add the dim capability to the template.
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
TestOHPCFDimGate, consider avoiding direct mutation of internal fields likec.dimmedand instead exercise the public API (e.g.Dim) or a small helper constructor to keep tests resilient to internal refactors. - In
Dim, you could early-return when the requesteddimstate matches the currentc.dimmedvalue to avoid unnecessaryapply()calls and external interactions when there is no effective state change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `TestOHPCFDimGate`, consider avoiding direct mutation of internal fields like `c.dimmed` and instead exercise the public API (e.g. `Dim`) or a small helper constructor to keep tests resilient to internal refactors.
- In `Dim`, you could early-return when the requested `dim` state matches the current `c.dimmed` value to avoid unnecessary `apply()` calls and external interactions when there is no effective state change.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Member
Author
|
Superseded by #31348: dimming now uses the EG LPC consumption limit (like the EEBus meter) instead of OHPCF schedule/pause, and is based on 🤖 Generated with Claude Code |
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.
The OHPCF heat pump charger (#30636) ignored an active EnWG §14a / LPC consumption limit: it only honoured PV surplus, never the grid-side cap evcc receives as a controllable system.
This implements
api.Dimmeron the OHPCF charger, the same hook the loadpoint already uses to push the HEMS dim state down to a charger:Dim(true)pauses (or aborts, if the compressor is not pausable) the optional consumption;Dim(false)releases it and resumes per the on/off intent.Dimmed()reports the current dim state.controlEnable), so a dim always wins over surplus.dimcapability.go build,go vet, charger + template tests, gofmt and golangci-lint all pass.🤖 Generated with Claude Code