evcc-io/tariff/fixed.go
andig 986d73489d
Some checks failed
Build / Build (push) Failing after 6m48s
Build / Build UI (push) Failing after 1m29s
Validate Schema / build (push) Failing after 3s
Build / Publish :latest (push) Has been skipped
Build / Publish :release (push) Has been skipped
Build / Release (push) Has been skipped
Add Awattar and Tibber (#1169)
2021-07-24 11:53:05 +02:00

26 lines
382 B
Go

package tariff
import (
"github.com/andig/evcc/api"
"github.com/andig/evcc/util"
)
type Fixed struct {
Price float64
}
var _ api.Tariff = (*Fixed)(nil)
func NewFixed(other map[string]interface{}) (*Fixed, error) {
cc := Fixed{}
if err := util.DecodeOther(other, &cc); err != nil {
return nil, err
}
return &cc, nil
}
func (t *Fixed) IsCheap() bool {
return false
}