Add dedicated co2 tariff (#8089)

---------

Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
andig 2023-05-31 09:19:36 +02:00 • committed by GitHub
parent 15b60863c1
commit 7c3ca53f02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 267 additions and 215 deletions

View file

@ -201,26 +201,10 @@ type Resurrector interface {
WakeUp() error
}
// Rate is a grid tariff rate
type Rate struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Price float64 `json:"price"`
}
// IsEmpty returns is the rate is the zero value
func (r Rate) IsEmpty() bool {
return r.Start.IsZero() && r.End.IsZero() && r.Price == 0
}
// Rates is a slice of (future) tariff rates
type Rates []Rate
// Tariff is a tariff capable of retrieving tariff rates
type Tariff interface {
Unit() string
Rates() (Rates, error)
IsDynamic() bool
Type() TariffType
}
// AuthProvider is the ability to provide OAuth authentication through the ui