Load Management and Peak Shaving (#13207)

This commit is contained in:
andig 2024-04-27 10:50:35 +02:00 • committed by GitHub
parent 652cab3192
commit 26973a0d2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 1339 additions and 49 deletions

View file

@ -7,7 +7,7 @@ import (
"time"
)
//go:generate mockgen -package api -destination mock.go github.com/evcc-io/evcc/api Charger,ChargeState,CurrentLimiter,PhaseSwitcher,Identifier,Meter,MeterEnergy,Vehicle,ChargeRater,Battery,Tariff,BatteryController
//go:generate mockgen -package api -destination mock.go github.com/evcc-io/evcc/api Charger,ChargeState,CurrentLimiter,PhaseSwitcher,Identifier,Meter,MeterEnergy,PhaseCurrents,Vehicle,ChargeRater,Battery,Tariff,BatteryController,Circuit
// Meter provides total active power in W
type Meter interface {
@ -202,3 +202,32 @@ type FeatureDescriber interface {
type CsvWriter interface {
WriteCsv(context.Context, io.Writer) error
}
// CircuitMeasurements is the measurements a circuit or load must deliver
type CircuitMeasurements interface {
GetChargePower() float64
GetMaxPhaseCurrent() float64
}
// CircuitLoad represents a loadpoint attached to a circuit
type CircuitLoad interface {
CircuitMeasurements
GetCircuit() Circuit
}
// Circuit defines the load control domain
type Circuit interface {
CircuitMeasurements
GetTitle() string
SetTitle(string)
GetParent() Circuit
RegisterChild(child Circuit)
HasMeter() bool
GetMaxPower() float64
GetMaxCurrent() float64
SetMaxPower(float64)
SetMaxCurrent(float64)
Update([]CircuitLoad) error
ValidateCurrent(old, new float64) float64
ValidatePower(old, new float64) float64
}