From 25811ce03cb622e86eda00f22aac7dbc533b28ca Mon Sep 17 00:00:00 2001 From: ygelfand Date: Wed, 21 Feb 2024 09:34:38 -0500 Subject: [PATCH] connected state Signed-off-by: ygelfand --- Makefile | 2 +- internal/api/strings.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a97718f..9b10175 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || \ echo v0) all: - go build \ + @go build \ -tags release \ -ldflags '-X github.com/ygelfand/go-powerwall/cmd.GoPowerwallVersion=$(VERSION)' \ -o bin/go-powerwall main.go diff --git a/internal/api/strings.go b/internal/api/strings.go index b64bae4..439e73a 100644 --- a/internal/api/strings.go +++ b/internal/api/strings.go @@ -19,30 +19,29 @@ func (app *Api) parsedStrings() map[string]PvacString { for id, inv := range app.powerwall.Controller.EsCan.Bus.Pvac { if !inv.PVACStatus.IsMIA { idx := pvacIndex(id) - // TODO: individual string connected state? strings[fmt.Sprintf("A%s", idx)] = PvacString{ Current: inv.PVACLogging.PVACPVCurrentA, Voltage: inv.PVACLogging.PVACPVMeasuredVoltageA, State: inv.PVACStatus.PVACState, - Connected: !inv.PVACLogging.IsMIA, + Connected: app.powerwall.Controller.EsCan.Bus.Pvs[id].PVSStatus.PVSStringAConnected, } strings[fmt.Sprintf("B%s", idx)] = PvacString{ Current: inv.PVACLogging.PVACPVCurrentB, Voltage: inv.PVACLogging.PVACPVMeasuredVoltageB, State: inv.PVACStatus.PVACState, - Connected: !inv.PVACLogging.IsMIA, + Connected: app.powerwall.Controller.EsCan.Bus.Pvs[id].PVSStatus.PVSStringBConnected, } strings[fmt.Sprintf("C%s", idx)] = PvacString{ Current: inv.PVACLogging.PVACPVCurrentC, Voltage: inv.PVACLogging.PVACPVMeasuredVoltageC, State: inv.PVACStatus.PVACState, - Connected: !inv.PVACLogging.IsMIA, + Connected: app.powerwall.Controller.EsCan.Bus.Pvs[id].PVSStatus.PVSStringCConnected, } strings[fmt.Sprintf("D%s", idx)] = PvacString{ Current: inv.PVACLogging.PVACPVCurrentD, Voltage: inv.PVACLogging.PVACPVMeasuredVoltageD, State: inv.PVACStatus.PVACState, - Connected: !inv.PVACLogging.IsMIA, + Connected: app.powerwall.Controller.EsCan.Bus.Pvs[id].PVSStatus.PVSStringDConnected, } } }