From 76dc949661566d1c2de661bc051335a4ea44dcc7 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 10 Jan 2025 17:04:19 +0100 Subject: [PATCH] chore: simplify --- charger/mypv.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/charger/mypv.go b/charger/mypv.go index c6a5d27589..75ccee23bd 100644 --- a/charger/mypv.go +++ b/charger/mypv.go @@ -132,13 +132,12 @@ func (wb *MyPv) heartbeat(ctx context.Context, timeout time.Duration) { // Status implements the api.Charger interface func (wb *MyPv) Status() (api.ChargeStatus, error) { - res := api.StatusA b, err := wb.conn.ReadHoldingRegisters(elwaRegStatus, 1) if err != nil { - return res, err + return api.StatusNone, err } - res = api.StatusB + res := api.StatusB if binary.BigEndian.Uint16(b) == 2 { res = api.StatusC }