Charger: tag templates with meter capability#29536
Conversation
…conditional Adds a new "meter" template capability and tags every charger template whose Go implementation always exposes CurrentPower (i.e., either via a direct struct method or a decorator that is always wired with a non-nil currentPower). Chargers that conditionally provide CurrentPower (depending on register/feature checks, optional config, or sponsorship) are not tagged. Closes #11692 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The PR description says Smart EVSE variants were intentionally skipped due to conditional
CurrentPower, butsmartevse.yamlis tagged withmeter; please double‑check whether this template should really advertise an unconditional meter capability or adjust the description. - For many of the updated YAML templates the
capabilitiesarrays now have a mixed order (e.g., `['mA', 'rfid', '1p3p', 'meter'] vs earlier patterns); consider standardizing the ordering (alphabetical or by importance) to keep future diffs smaller and the templates easier to scan.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The PR description says Smart EVSE variants were intentionally skipped due to conditional `CurrentPower`, but `smartevse.yaml` is tagged with `meter`; please double‑check whether this template should really advertise an unconditional meter capability or adjust the description.
- For many of the updated YAML templates the `capabilities` arrays now have a mixed order (e.g., `['mA', 'rfid', '1p3p', 'meter'] vs earlier patterns); consider standardizing the ordering (alphabetical or by importance) to keep future diffs smaller and the templates easier to scan.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Sort capabilities consistently as iso151182, mA, rfid, 1p3p, meter to match the order in ValidCapabilities and keep future diffs stable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressing the review feedback:
|
| @@ -9,6 +9,7 @@ products: | |||
| description: | |||
| de: Pro (vor ~2019, ohne Strommessgerät) | |||
There was a problem hiding this comment.
Die wallbe*-Implementierungen/Templates sind völlig veraltet und können ganz raus. Das läuft alles einheitlich über phoenix-ev-eth.
|
@copilot resolve the merge conflicts in this pull request |
…capability # Conflicts: # templates/definition/charger/eebus.yaml # templates/definition/charger/porsche-pmcc.yaml # templates/definition/charger/porsche-pmcp.yaml Co-authored-by: andig <184815+andig@users.noreply.github.com>
Resolved in 9f998f0. The conflicts were in |
|
Would it be useful to implement a meter type attribute for standard, MID, Eichrecht? The later two could be suffixed with "-conform". |
|
@copilot resolve the merge conflicts in this pull request |
…capability # Conflicts: # templates/definition/charger/openwb-2.0.yaml Co-authored-by: andig <184815+andig@users.noreply.github.com>
Resolved in cf7c6cb. One real conflict in |
Summary
metertemplate capability (util/templates/types.go)CurrentPower()— either via a direct struct method or a decorator that is always wired with a non-nilcurrentPowerargumentpower:block, sponsor-gated, optional URL) are intentionally not taggedCloses #11692
Categories of touched templates
meter: true: eebus, elli-2, elli-charger-pro, ghost, porsche-pmcc/pmcp/wallboxpower:block: askoheat, idm, kermi, lambda-zewotherm, mtecmeter.power: truealways set: wallbe-meter, wallbe-pre2019-meterevsewifiwithmeter.power: true)Skipped (conditional CurrentPower)
powerGonly set onHasMeasurement(PowerActiveImport))power:(daikin-homehub-air2air, daikin-homehub, glen-dimplex, lg-therma, luxtronik, nibe-s-series, stiebel-lwa, stiebel-wpm, viessmann, weishaupt-wpm), heatpump templates withoutpower:(ochsner-bwwp, xtherma)poweris optional/advanced), homeassistant-switch (standbypower<0disables it)Skipped (no CurrentPower at all)
Test plan
go build ./...cleango test ./util/templates/...passes (capability validation lints all entries)metercapability tag for filtering oncemake docsregenerates