Skip to content

Commit

Permalink
Init local usecase server data on demo cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Sep 21, 2024
1 parent 238b900 commit b7d0731
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/evse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/enbility/eebus-go/api"
"github.com/enbility/eebus-go/service"
ucapi "github.com/enbility/eebus-go/usecases/api"
"github.com/enbility/eebus-go/usecases/cs/lpc"
shipapi "github.com/enbility/ship-go/api"
"github.com/enbility/ship-go/cert"
Expand Down Expand Up @@ -92,6 +93,16 @@ func (h *evse) run() {
h.uclpc = lpc.NewLPC(localEntity, h.OnLPCEvent)
h.myService.AddUseCase(h.uclpc)

// Initialize local server data
_ = h.uclpc.SetConsumptionNominalMax(32000)
_ = h.uclpc.SetConsumptionLimit(ucapi.LoadLimit{
Value: 4200,
IsChangeable: true,
IsActive: false,
})
_ = h.uclpc.SetFailsafeConsumptionActivePowerLimit(4200, true)
_ = h.uclpc.SetFailsafeDurationMinimum(2*time.Hour, true)

if len(remoteSki) == 0 {
os.Exit(0)
}
Expand Down
19 changes: 19 additions & 0 deletions cmd/hems/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@ func (h *hems) run() {
h.uceglpp = eglpp.NewLPP(localEntity, nil)
h.myService.AddUseCase(h.uceglpp)

// Initialize local server data
_ = h.uccslpc.SetConsumptionNominalMax(32000)
_ = h.uccslpc.SetConsumptionLimit(ucapi.LoadLimit{
Value: 4200,
IsChangeable: true,
IsActive: false,
})
_ = h.uccslpc.SetFailsafeConsumptionActivePowerLimit(4200, true)
_ = h.uccslpc.SetFailsafeDurationMinimum(2*time.Hour, true)

_ = h.uccslpp.SetProductionNominalMax(10000)
_ = h.uccslpp.SetProductionLimit(ucapi.LoadLimit{
Value: 10000,
IsChangeable: true,
IsActive: false,
})
_ = h.uccslpp.SetFailsafeProductionActivePowerLimit(4200, true)
_ = h.uccslpp.SetFailsafeDurationMinimum(2*time.Hour, true)

if len(remoteSki) == 0 {
os.Exit(0)
}
Expand Down

0 comments on commit b7d0731

Please sign in to comment.