Skip to content

Commit b7d0731

Browse files
committed
Init local usecase server data on demo cmds
1 parent 238b900 commit b7d0731

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

cmd/evse/main.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/enbility/eebus-go/api"
1717
"github.com/enbility/eebus-go/service"
18+
ucapi "github.com/enbility/eebus-go/usecases/api"
1819
"github.com/enbility/eebus-go/usecases/cs/lpc"
1920
shipapi "github.com/enbility/ship-go/api"
2021
"github.com/enbility/ship-go/cert"
@@ -92,6 +93,16 @@ func (h *evse) run() {
9293
h.uclpc = lpc.NewLPC(localEntity, h.OnLPCEvent)
9394
h.myService.AddUseCase(h.uclpc)
9495

96+
// Initialize local server data
97+
_ = h.uclpc.SetConsumptionNominalMax(32000)
98+
_ = h.uclpc.SetConsumptionLimit(ucapi.LoadLimit{
99+
Value: 4200,
100+
IsChangeable: true,
101+
IsActive: false,
102+
})
103+
_ = h.uclpc.SetFailsafeConsumptionActivePowerLimit(4200, true)
104+
_ = h.uclpc.SetFailsafeDurationMinimum(2*time.Hour, true)
105+
95106
if len(remoteSki) == 0 {
96107
os.Exit(0)
97108
}

cmd/hems/main.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ func (h *hems) run() {
103103
h.uceglpp = eglpp.NewLPP(localEntity, nil)
104104
h.myService.AddUseCase(h.uceglpp)
105105

106+
// Initialize local server data
107+
_ = h.uccslpc.SetConsumptionNominalMax(32000)
108+
_ = h.uccslpc.SetConsumptionLimit(ucapi.LoadLimit{
109+
Value: 4200,
110+
IsChangeable: true,
111+
IsActive: false,
112+
})
113+
_ = h.uccslpc.SetFailsafeConsumptionActivePowerLimit(4200, true)
114+
_ = h.uccslpc.SetFailsafeDurationMinimum(2*time.Hour, true)
115+
116+
_ = h.uccslpp.SetProductionNominalMax(10000)
117+
_ = h.uccslpp.SetProductionLimit(ucapi.LoadLimit{
118+
Value: 10000,
119+
IsChangeable: true,
120+
IsActive: false,
121+
})
122+
_ = h.uccslpp.SetFailsafeProductionActivePowerLimit(4200, true)
123+
_ = h.uccslpp.SetFailsafeDurationMinimum(2*time.Hour, true)
124+
106125
if len(remoteSki) == 0 {
107126
os.Exit(0)
108127
}

0 commit comments

Comments
 (0)