• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

enbility / eebus-go / 27195008224
95%

Build:
DEFAULT BRANCH: dev
Ran 09 Jun 2026 08:54AM UTC
Jobs 1
Files 90
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jun 2026 08:52AM UTC coverage: 95.268% (-0.02%) from 95.286%
27195008224

push

github

web-flow
Fix wrong parameter description selection in LoadControlLimits (#218)

Fixes #217.

Asked Claude for a fix since
[evcc-io/evcc](https://github.com/evcc-io/evcc) uses both opev and
oscev. Fix is LGTM.

## Problem

`LoadControlLimits` and `WriteLoadControlPhaseLimits` in
`usecases/internal/loadcontrol.go` looked up
`ElectricalConnectionParameterDescription` entries filtered only by
`AcMeasuredPhases` and then blindly used `elParamDesc[0]`. If a remote
device exposes more than one description per phase (e.g. current and
voltage), the wrong entry could be picked and the limit would be
resolved against an unrelated `MeasurementId` / `ParameterId`.
Additionally, `*elParamDesc[0].ParameterId` was dereferenced without a
nil guard on the write side, which could panic against a conformant
remote that omits the optional `ParameterId`.

Not observed on Elli, Porsche MCC, or SMA HEM 2.0 (they only expose
current descriptions), but a conformant device is allowed to expose more
— and the bug surfaces whenever a non-current description is listed
first.

## Fix

Walk all parameter descriptions for the phase and pick the one whose
`MeasurementId` is referenced by one of the limit descriptions, then use
that description's `ParameterId` for the permitted-value lookup /
adjustment. Adds the missing `ParameterId` nil guard on the write path.

The four public entry points are all thin wrappers over the two internal
helpers and inherit the fix:

- `opev.OPEV.LoadControlLimits` / `opev.OPEV.WriteLoadControlLimits`
- `oscev.OSCEV.LoadControlLimits` / `oscev.OSCEV.WriteLoadControlLimits`

28 of 30 new or added lines in 1 file covered. (93.33%)

1 existing line in 1 file now uncovered.

7248 of 7608 relevant lines covered (95.27%)

12.41 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
93.4
-0.59% usecases/internal/loadcontrol.go

Coverage Regressions

Lines Coverage ∆ File
1
93.4
-0.59% usecases/internal/loadcontrol.go
Jobs
ID Job ID Ran Files Coverage
1 27195008224.1 09 Jun 2026 08:54AM UTC 90
95.27
GitHub Action Run
Source Files on build 27195008224
  • Tree
  • List 90
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27195008224
  • 8bc0cd1a on github
  • Prev Build on dev (#26174189335)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc