Simplify HEMS api (#31428)
This commit is contained in:
parent
199365288a
commit
e239af5d25
16 changed files with 255 additions and 121 deletions
|
|
@ -285,10 +285,9 @@ type Circuit interface {
|
|||
// HEMS exposes the runtime state of the home energy management system.
|
||||
type HEMS interface {
|
||||
SetUpdated(func())
|
||||
Dimmed() *bool // nil = no statement
|
||||
MaxConsumptionPower() float64 // 0 = no limit
|
||||
CurtailedPercent() *int // allowed feed-in percent of nominal production power (0..100), nil = no statement
|
||||
MaxProductionPower() *float64 // nil = no limit
|
||||
CurtailedPercent() *int // allowed feed-in percent of nominal production power (0..100), nil = no statement
|
||||
MaxProductionPower() *float64 // nil = limiting undefined, else active limit
|
||||
MaxConsumptionPower() *float64 // nil = limiting undefined, else active limit (0 = none)
|
||||
}
|
||||
|
||||
// Redactor is an interface to redact sensitive data
|
||||
|
|
|
|||
18
api/mock.go
18
api/mock.go
|
|
@ -1226,25 +1226,11 @@ func (mr *MockHEMSMockRecorder) CurtailedPercent() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurtailedPercent", reflect.TypeOf((*MockHEMS)(nil).CurtailedPercent))
|
||||
}
|
||||
|
||||
// Dimmed mocks base method.
|
||||
func (m *MockHEMS) Dimmed() *bool {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Dimmed")
|
||||
ret0, _ := ret[0].(*bool)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Dimmed indicates an expected call of Dimmed.
|
||||
func (mr *MockHEMSMockRecorder) Dimmed() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dimmed", reflect.TypeOf((*MockHEMS)(nil).Dimmed))
|
||||
}
|
||||
|
||||
// MaxConsumptionPower mocks base method.
|
||||
func (m *MockHEMS) MaxConsumptionPower() float64 {
|
||||
func (m *MockHEMS) MaxConsumptionPower() *float64 {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MaxConsumptionPower")
|
||||
ret0, _ := ret[0].(float64)
|
||||
ret0, _ := ret[0].(*float64)
|
||||
return ret0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue