From a1634e25bb809a540ddebe9006847a4c293d0105 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 23 Apr 2026 16:34:22 +0200 Subject: [PATCH] chore: reorder params --- meter/eebus.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meter/eebus.go b/meter/eebus.go index f2e4310c3..aa14e29c9 100644 --- a/meter/eebus.go +++ b/meter/eebus.go @@ -116,7 +116,7 @@ func NewEEBus(ctx context.Context, ski, ip string, usage *templates.Usage) (api. return c, nil } -func eebusReadValue[T any](scenario uint, uc eebusapi.UseCaseBaseInterface, entity spineapi.EntityRemoteInterface, update func(entity spineapi.EntityRemoteInterface) (T, error)) (T, error) { +func eebusReadValue[T any](uc eebusapi.UseCaseBaseInterface, entity spineapi.EntityRemoteInterface, scenario uint, update func(entity spineapi.EntityRemoteInterface) (T, error)) (T, error) { var zero T if entity == nil || !uc.IsScenarioAvailableAtEntity(entity, scenario) { @@ -138,7 +138,7 @@ func eebusReadValue[T any](scenario uint, uc eebusapi.UseCaseBaseInterface, enti func (c *EEBus) readValue(scenario uint, update func(entity spineapi.EntityRemoteInterface) (float64, error)) (float64, error) { c.mu.Lock() defer c.mu.Unlock() - return eebusReadValue(scenario, c.mm, c.maEntity, update) + return eebusReadValue(c.mm, c.maEntity, scenario, update) } var _ api.Meter = (*EEBus)(nil) @@ -157,7 +157,7 @@ func (c *EEBus) readPhases(scenario uint, update func(entity spineapi.EntityRemo c.mu.Lock() defer c.mu.Unlock() - res, err := eebusReadValue(scenario, c.mm, c.maEntity, update) + res, err := eebusReadValue(c.mm, c.maEntity, scenario, update) if err != nil { // announced but not provided if errors.Is(err, eebusapi.ErrDataNotAvailable) { @@ -200,7 +200,7 @@ func (c *EEBus) Dimmed() (bool, error) { c.mu.Lock() defer c.mu.Unlock() - limit, err := eebusReadValue(1, c.eg.EgLPCInterface, c.egLpcEntity, c.eg.EgLPCInterface.ConsumptionLimit) + limit, err := eebusReadValue(c.eg.EgLPCInterface, c.egLpcEntity, 1, c.eg.EgLPCInterface.ConsumptionLimit) if err != nil { return false, err } @@ -244,7 +244,7 @@ func (c *EEBus) Curtailed() (bool, error) { c.mu.Lock() defer c.mu.Unlock() - limit, err := eebusReadValue(1, c.eg.EgLPPInterface, c.egLppEntity, c.eg.EgLPPInterface.ProductionLimit) + limit, err := eebusReadValue(c.eg.EgLPPInterface, c.egLppEntity, 1, c.eg.EgLPPInterface.ProductionLimit) if err != nil { return false, err }