Skip to content

Commit

Permalink
Load Management and Peak Shaving (#13207)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 27, 2024
1 parent 652cab3 commit 26973a0
Show file tree
Hide file tree
Showing 24 changed files with 1,339 additions and 49 deletions.
31 changes: 30 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
255 changes: 253 additions & 2 deletions api/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 26973a0

Please sign in to comment.