Skip to content

Commit

Permalink
connected state
Browse files Browse the repository at this point in the history
Signed-off-by: ygelfand <[email protected]>
  • Loading branch information
ygelfand committed Feb 21, 2024
1 parent fd202bc commit 25811ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 4 additions & 5 deletions internal/api/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
}
Expand Down

0 comments on commit 25811ce

Please sign in to comment.