41 lines
904 B
Go
41 lines
904 B
Go
package charger
|
|
|
|
// Code generated by github.com/evcc-io/evcc/cmd/tools/decorate.go. DO NOT EDIT.
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"github.com/evcc-io/evcc/api"
|
|
)
|
|
|
|
func decoratePulsares(base *Pulsares, phaseSwitcher func(int) error) api.Charger {
|
|
caps := make(map[reflect.Type]any)
|
|
|
|
if phaseSwitcher != nil {
|
|
caps[reflect.TypeFor[api.PhaseSwitcher]()] = &decoratePulsaresPhaseSwitcherImpl{phaseSwitcher: phaseSwitcher}
|
|
}
|
|
|
|
if len(caps) == 0 {
|
|
return base
|
|
}
|
|
|
|
return &decoratePulsaresCapable{Pulsares: base, caps: caps}
|
|
}
|
|
|
|
type decoratePulsaresCapable struct {
|
|
*Pulsares
|
|
caps map[reflect.Type]any
|
|
}
|
|
|
|
func (d *decoratePulsaresCapable) Capability(typ reflect.Type) (any, bool) {
|
|
c, ok := d.caps[typ]
|
|
return c, ok
|
|
}
|
|
|
|
type decoratePulsaresPhaseSwitcherImpl struct {
|
|
phaseSwitcher func(int) error
|
|
}
|
|
|
|
func (impl *decoratePulsaresPhaseSwitcherImpl) Phases1p3p(p0 int) error {
|
|
return impl.phaseSwitcher(p0)
|
|
}
|