Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Management and Peak Shaving #13207

Merged
merged 35 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading