EEBus: add dimming (#24595)

This commit is contained in:
andig 2025-11-02 16:24:34 +01:00 • committed by GitHub
parent 4c75a5ea5d
commit 6ef847b05b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 129 additions and 9 deletions

View file

@ -22,6 +22,7 @@ import (
"github.com/enbility/eebus-go/usecases/cem/oscev"
"github.com/enbility/eebus-go/usecases/cs/lpc"
"github.com/enbility/eebus-go/usecases/cs/lpp"
eglpc "github.com/enbility/eebus-go/usecases/eg/lpc"
"github.com/enbility/eebus-go/usecases/ma/mgcp"
"github.com/enbility/eebus-go/usecases/ma/mpc"
shipapi "github.com/enbility/ship-go/api"
@ -60,12 +61,18 @@ type MonitoringAppliance struct {
ucapi.MaMPCInterface
}
// Energy Guard
type EnergyGuard struct {
ucapi.EgLPCInterface
}
type EEBus struct {
service eebusapi.ServiceInterface
cem CustomerEnergyManagement
cs ControllableSystem
ma MonitoringAppliance
eg EnergyGuard
mux sync.Mutex
log *util.Logger
@ -170,6 +177,11 @@ func NewServer(other Config) (*EEBus, error) {
MaMPCInterface: mpc.NewMPC(localEntity, c.ucCallback),
}
// energy guard
c.eg = EnergyGuard{
EgLPCInterface: eglpc.NewLPC(localEntity, c.ucCallback),
}
// register use cases
for _, uc := range []eebusapi.UseCaseInterface{
c.cem.EvseCC, c.cem.EvCC,
@ -177,6 +189,7 @@ func NewServer(other Config) (*EEBus, error) {
c.cem.OscEV, c.cem.EvSoc,
c.cs.CsLPCInterface, c.cs.CsLPPInterface,
c.ma.MaMGCPInterface, c.ma.MaMPCInterface,
c.eg.EgLPCInterface,
} {
c.service.AddUseCase(uc)
}
@ -230,6 +243,10 @@ func (c *EEBus) MonitoringAppliance() *MonitoringAppliance {
return &c.ma
}
func (c *EEBus) EnergyGuard() *EnergyGuard {
return &c.eg
}
func (c *EEBus) Run() {
c.service.Start()
}