chore: rename ChargePhases api to PhaseSwitcher (#4105)
This commit is contained in:
parent
f9e3027bbf
commit
8ad84d4278
20 changed files with 91 additions and 91 deletions
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/fatih/structs"
|
||||
)
|
||||
|
||||
//go:generate mockgen -package mock -destination ../mock/mock_api.go github.com/evcc-io/evcc/api Charger,ChargeState,ChargePhases,Identifier,Meter,MeterEnergy,Vehicle,ChargeRater,Battery
|
||||
//go:generate mockgen -package mock -destination ../mock/mock_api.go github.com/evcc-io/evcc/api Charger,ChargeState,PhaseSwitcher,Identifier,Meter,MeterEnergy,Vehicle,ChargeRater,Battery
|
||||
|
||||
// ChargeMode are charge modes modeled after OpenWB
|
||||
type ChargeMode string
|
||||
|
|
@ -107,8 +107,8 @@ type ChargerEx interface {
|
|||
MaxCurrentMillis(current float64) error
|
||||
}
|
||||
|
||||
// ChargePhases provides 1p3p switching
|
||||
type ChargePhases interface {
|
||||
// PhaseSwitcher provides 1p3p switching
|
||||
type PhaseSwitcher interface {
|
||||
Phases1p3p(phases int) error
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,9 +116,9 @@ func (wb *Blueprint) Identify() (string, error) {
|
|||
return "", api.ErrNotAvailable
|
||||
}
|
||||
|
||||
var _ api.ChargePhases = (*Blueprint)(nil)
|
||||
var _ api.PhaseSwitcher = (*Blueprint)(nil)
|
||||
|
||||
// Phases1p3p implements the api.ChargePhases interface
|
||||
// Phases1p3p implements the api.PhaseSwitcher interface
|
||||
func (wb *Blueprint) Phases1p3p(phases int) error {
|
||||
return api.ErrNotAvailable
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,9 +249,9 @@ func (wb *ABB) Currents() (float64, float64, float64, error) {
|
|||
return curr[0], curr[1], curr[2], nil
|
||||
}
|
||||
|
||||
// var _ api.ChargePhases = (*ABB)(nil)
|
||||
// var _ api.PhaseSwitcher = (*ABB)(nil)
|
||||
|
||||
// // Phases1p3p implements the api.ChargePhases interface
|
||||
// // Phases1p3p implements the api.PhaseSwitcher interface
|
||||
// func (wb *ABB) Phases1p3p(phases int) error {
|
||||
// var b uint16 = 1
|
||||
// if phases != 1 {
|
||||
|
|
|
|||
|
|
@ -228,9 +228,9 @@ func (wb *Alfen) Currents() (float64, float64, float64, error) {
|
|||
return currents[0], currents[1], currents[2], nil
|
||||
}
|
||||
|
||||
var _ api.ChargePhases = (*Alfen)(nil)
|
||||
var _ api.PhaseSwitcher = (*Alfen)(nil)
|
||||
|
||||
// Phases1p3p implements the api.ChargePhases interface
|
||||
// Phases1p3p implements the api.PhaseSwitcher interface
|
||||
func (c *Alfen) Phases1p3p(phases int) error {
|
||||
_, err := c.conn.WriteSingleRegister(alfenRegPhases, uint16(phases))
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -205,9 +205,9 @@ func (wb *Dadapower) Currents() (float64, float64, float64, error) {
|
|||
return currents[0], currents[1], currents[2], nil
|
||||
}
|
||||
|
||||
var _ api.ChargePhases = (*Dadapower)(nil)
|
||||
var _ api.PhaseSwitcher = (*Dadapower)(nil)
|
||||
|
||||
// Phases1p3p implements the api.ChargePhases interface
|
||||
// Phases1p3p implements the api.PhaseSwitcher interface
|
||||
func (wb *Dadapower) Phases1p3p(phases int) error {
|
||||
_, err := wb.conn.WriteSingleRegister(dadapowerRegActivePhases+wb.regOffset, uint16(phases))
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -406,9 +406,9 @@ func (c *Easee) MaxCurrent(current int64) error {
|
|||
return err
|
||||
}
|
||||
|
||||
var _ api.ChargePhases = (*Easee)(nil)
|
||||
var _ api.PhaseSwitcher = (*Easee)(nil)
|
||||
|
||||
// Phases1p3p implements the api.ChargePhases interface
|
||||
// Phases1p3p implements the api.PhaseSwitcher interface
|
||||
func (c *Easee) Phases1p3p(phases int) error {
|
||||
var err error
|
||||
if c.circuit != 0 {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func init() {
|
|||
registry.Add("go-e", NewGoEFromConfig)
|
||||
}
|
||||
|
||||
// go:generate go run ../cmd/tools/decorate.go -f decorateGoE -b *GoE -r api.Charger -t "api.MeterEnergy,TotalEnergy,func() (float64, error)" -t "api.ChargePhases,Phases1p3p,func(int) (error)"
|
||||
// go:generate go run ../cmd/tools/decorate.go -f decorateGoE -b *GoE -r api.Charger -t "api.MeterEnergy,TotalEnergy,func() (float64, error)" -t "api.PhaseSwitcher,Phases1p3p,func(int) (error)"
|
||||
|
||||
// NewGoEFromConfig creates a go-e charger from generic config
|
||||
func NewGoEFromConfig(other map[string]interface{}) (api.Charger, error) {
|
||||
|
|
@ -205,7 +205,7 @@ func (c *GoE) totalEnergy() (float64, error) {
|
|||
return val, err
|
||||
}
|
||||
|
||||
// phases1p3p implements the api.ChargePhases interface - v2 only
|
||||
// phases1p3p implements the api.PhaseSwitcher interface - v2 only
|
||||
func (c *GoE) phases1p3p(phases int) error {
|
||||
if phases == 3 {
|
||||
phases = 2
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import (
|
|||
"github.com/evcc-io/evcc/api"
|
||||
)
|
||||
|
||||
func decorateGoE(base *GoE, meterEnergy func() (float64, error), chargePhases func(phases int) error) api.Charger {
|
||||
func decorateGoE(base *GoE, meterEnergy func() (float64, error), phaseSwitcher func(phases int) error) api.Charger {
|
||||
switch {
|
||||
case chargePhases == nil && meterEnergy == nil:
|
||||
case phaseSwitcher == nil && meterEnergy == nil:
|
||||
return base
|
||||
|
||||
case chargePhases == nil && meterEnergy != nil:
|
||||
case phaseSwitcher == nil && meterEnergy != nil:
|
||||
return &struct {
|
||||
*GoE
|
||||
api.MeterEnergy
|
||||
|
|
@ -22,26 +22,26 @@ func decorateGoE(base *GoE, meterEnergy func() (float64, error), chargePhases fu
|
|||
},
|
||||
}
|
||||
|
||||
case chargePhases != nil && meterEnergy == nil:
|
||||
case phaseSwitcher != nil && meterEnergy == nil:
|
||||
return &struct {
|
||||
*GoE
|
||||
api.ChargePhases
|
||||
api.PhaseSwitcher
|
||||
}{
|
||||
GoE: base,
|
||||
ChargePhases: &decorateGoEChargePhasesImpl{
|
||||
chargePhases: chargePhases,
|
||||
PhaseSwitcher: &decorateGoEPhaseSwitcherImpl{
|
||||
phaseSwitcher: phaseSwitcher,
|
||||
},
|
||||
}
|
||||
|
||||
case chargePhases != nil && meterEnergy != nil:
|
||||
case phaseSwitcher != nil && meterEnergy != nil:
|
||||
return &struct {
|
||||
*GoE
|
||||
api.ChargePhases
|
||||
api.PhaseSwitcher
|
||||
api.MeterEnergy
|
||||
}{
|
||||
GoE: base,
|
||||
ChargePhases: &decorateGoEChargePhasesImpl{
|
||||
chargePhases: chargePhases,
|
||||
PhaseSwitcher: &decorateGoEPhaseSwitcherImpl{
|
||||
phaseSwitcher: phaseSwitcher,
|
||||
},
|
||||
MeterEnergy: &decorateGoEMeterEnergyImpl{
|
||||
meterEnergy: meterEnergy,
|
||||
|
|
@ -52,12 +52,12 @@ func decorateGoE(base *GoE, meterEnergy func() (float64, error), chargePhases fu
|
|||
return nil
|
||||
}
|
||||
|
||||
type decorateGoEChargePhasesImpl struct {
|
||||
chargePhases func(int) error
|
||||
type decorateGoEPhaseSwitcherImpl struct {
|
||||
phaseSwitcher func(int) error
|
||||
}
|
||||
|
||||
func (impl *decorateGoEChargePhasesImpl) Phases1p3p(phases int) error {
|
||||
return impl.chargePhases(phases)
|
||||
func (impl *decorateGoEPhaseSwitcherImpl) Phases1p3p(phases int) error {
|
||||
return impl.phaseSwitcher(phases)
|
||||
}
|
||||
|
||||
type decorateGoEMeterEnergyImpl struct {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ func TestGoEV2(t *testing.T) {
|
|||
t.Error("missing MeterEnergy api")
|
||||
}
|
||||
|
||||
if _, ok := wb.(api.ChargePhases); !ok {
|
||||
t.Error("missing ChargePhases api")
|
||||
if _, ok := wb.(api.PhaseSwitcher); !ok {
|
||||
t.Error("missing PhaseSwitcher api")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,9 +203,9 @@ func (wb *KSE) Currents() (float64, float64, float64, error) {
|
|||
return curr[0], curr[1], curr[2], nil
|
||||
}
|
||||
|
||||
// var _ api.ChargePhases = (*KSE)(nil)
|
||||
// var _ api.PhaseSwitcher = (*KSE)(nil)
|
||||
|
||||
// // Phases1p3p implements the api.ChargePhases interface
|
||||
// // Phases1p3p implements the api.PhaseSwitcher interface
|
||||
// func (wb *KSE) Phases1p3p(phases int) error {
|
||||
// var b uint16 = 0
|
||||
// if phases == 1 {
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ func (c *OCPP) Status() (api.ChargeStatus, error) {
|
|||
return c.cp.Status()
|
||||
}
|
||||
|
||||
// TODO: Phases1p3p implements the api.ChargePhases interface
|
||||
// TODO: Phases1p3p implements the api.PhaseSwitcher interface
|
||||
// func (c *OCPP) Phases1p3p(phases int) error {
|
||||
// if !c.phaseSwitchingSupported {
|
||||
// return fmt.Errorf("phase switching is not supported by the charger")
|
||||
|
|
|
|||
|
|
@ -180,9 +180,9 @@ func (wb *OpenWBPro) Currents() (float64, float64, float64, error) {
|
|||
return res.Currents[0], res.Currents[1], res.Currents[2], err
|
||||
}
|
||||
|
||||
var _ api.ChargePhases = (*OpenWBPro)(nil)
|
||||
var _ api.PhaseSwitcher = (*OpenWBPro)(nil)
|
||||
|
||||
// Phases1p3p implements the api.ChargePhases interface
|
||||
// Phases1p3p implements the api.PhaseSwitcher interface
|
||||
func (wb *OpenWBPro) Phases1p3p(phases int) error {
|
||||
return wb.set(fmt.Sprintf("phasetarget=%d", phases))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ type OpenWB struct {
|
|||
authS func(string) error
|
||||
}
|
||||
|
||||
// go:generate go run ../cmd/tools/decorate.go -f decorateOpenWB -b *OpenWB -r api.Charger -t "api.ChargePhases,Phases1p3p,func(int) (error)" -t "api.Battery,SoC,func() (float64, error)"
|
||||
// go:generate go run ../cmd/tools/decorate.go -f decorateOpenWB -b *OpenWB -r api.Charger -t "api.PhaseSwitcher,Phases1p3p,func(int) (error)" -t "api.Battery,SoC,func() (float64, error)"
|
||||
|
||||
// NewOpenWBFromConfig creates a new configurable charger
|
||||
func NewOpenWBFromConfig(other map[string]interface{}) (api.Charger, error) {
|
||||
|
|
|
|||
|
|
@ -6,23 +6,23 @@ import (
|
|||
"github.com/evcc-io/evcc/api"
|
||||
)
|
||||
|
||||
func decorateOpenWB(base *OpenWB, chargePhases func(int) error, battery func() (float64, error)) api.Charger {
|
||||
func decorateOpenWB(base *OpenWB, phaseSwitcher func(int) error, battery func() (float64, error)) api.Charger {
|
||||
switch {
|
||||
case battery == nil && chargePhases == nil:
|
||||
case battery == nil && phaseSwitcher == nil:
|
||||
return base
|
||||
|
||||
case battery == nil && chargePhases != nil:
|
||||
case battery == nil && phaseSwitcher != nil:
|
||||
return &struct {
|
||||
*OpenWB
|
||||
api.ChargePhases
|
||||
api.PhaseSwitcher
|
||||
}{
|
||||
OpenWB: base,
|
||||
ChargePhases: &decorateOpenWBChargePhasesImpl{
|
||||
chargePhases: chargePhases,
|
||||
PhaseSwitcher: &decorateOpenWBPhaseSwitcherImpl{
|
||||
phaseSwitcher: phaseSwitcher,
|
||||
},
|
||||
}
|
||||
|
||||
case battery != nil && chargePhases == nil:
|
||||
case battery != nil && phaseSwitcher == nil:
|
||||
return &struct {
|
||||
*OpenWB
|
||||
api.Battery
|
||||
|
|
@ -33,18 +33,18 @@ func decorateOpenWB(base *OpenWB, chargePhases func(int) error, battery func() (
|
|||
},
|
||||
}
|
||||
|
||||
case battery != nil && chargePhases != nil:
|
||||
case battery != nil && phaseSwitcher != nil:
|
||||
return &struct {
|
||||
*OpenWB
|
||||
api.Battery
|
||||
api.ChargePhases
|
||||
api.PhaseSwitcher
|
||||
}{
|
||||
OpenWB: base,
|
||||
Battery: &decorateOpenWBBatteryImpl{
|
||||
battery: battery,
|
||||
},
|
||||
ChargePhases: &decorateOpenWBChargePhasesImpl{
|
||||
chargePhases: chargePhases,
|
||||
PhaseSwitcher: &decorateOpenWBPhaseSwitcherImpl{
|
||||
phaseSwitcher: phaseSwitcher,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -60,10 +60,10 @@ func (impl *decorateOpenWBBatteryImpl) SoC() (float64, error) {
|
|||
return impl.battery()
|
||||
}
|
||||
|
||||
type decorateOpenWBChargePhasesImpl struct {
|
||||
chargePhases func(int) error
|
||||
type decorateOpenWBPhaseSwitcherImpl struct {
|
||||
phaseSwitcher func(int) error
|
||||
}
|
||||
|
||||
func (impl *decorateOpenWBChargePhasesImpl) Phases1p3p(phases int) error {
|
||||
return impl.chargePhases(phases)
|
||||
func (impl *decorateOpenWBPhaseSwitcherImpl) Phases1p3p(phases int) error {
|
||||
return impl.phaseSwitcher(phases)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ func NewLoadPointFromConfig(log *util.Logger, cp configProvider, other map[strin
|
|||
// setup fixed phases:
|
||||
// - simple charger starts with phases config if specified or 3p
|
||||
// - switchable charger starts at 0p since we don't know the current setting
|
||||
if _, ok := lp.charger.(api.ChargePhases); !ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); !ok {
|
||||
if lp.DefaultPhases == 0 {
|
||||
lp.DefaultPhases = 3
|
||||
lp.log.WARN.Println("phases not configured, assuming 3p")
|
||||
|
|
@ -1014,13 +1014,13 @@ func (lp *LoadPoint) resetPVTimerIfRunning(typ ...string) {
|
|||
lp.publishTimer(pvTimer, 0, timerInactive)
|
||||
}
|
||||
|
||||
// scalePhasesIfAvailable scales if api.ChargePhases is available
|
||||
// scalePhasesIfAvailable scales if api.PhaseSwitcher is available
|
||||
func (lp *LoadPoint) scalePhasesIfAvailable(phases int) error {
|
||||
if lp.DefaultPhases != 0 {
|
||||
phases = lp.DefaultPhases
|
||||
}
|
||||
|
||||
if _, ok := lp.charger.(api.ChargePhases); ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); ok {
|
||||
return lp.scalePhases(phases)
|
||||
}
|
||||
|
||||
|
|
@ -1036,7 +1036,7 @@ func (lp *LoadPoint) setDefaultPhases(phases int) {
|
|||
lp.phaseTimer = time.Time{}
|
||||
|
||||
// publish 1p3p capability and phase configuration
|
||||
if _, ok := lp.charger.(api.ChargePhases); ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); ok {
|
||||
lp.publish("phases1p3p", lp.DefaultPhases)
|
||||
} else {
|
||||
lp.publish("phases1p3p", nil)
|
||||
|
|
@ -1059,11 +1059,11 @@ func (lp *LoadPoint) setPhases(phases int) {
|
|||
}
|
||||
|
||||
// scalePhases adjusts the number of active phases and returns the appropriate charging current.
|
||||
// Returns api.ErrNotAvailable if api.ChargePhases is not available.
|
||||
// Returns api.ErrNotAvailable if api.PhaseSwitcher is not available.
|
||||
func (lp *LoadPoint) scalePhases(phases int) error {
|
||||
cp, ok := lp.charger.(api.ChargePhases)
|
||||
cp, ok := lp.charger.(api.PhaseSwitcher)
|
||||
if !ok {
|
||||
panic("charger does not implement api.ChargePhases")
|
||||
panic("charger does not implement api.PhaseSwitcher")
|
||||
}
|
||||
|
||||
if lp.GetPhases() != phases {
|
||||
|
|
@ -1210,7 +1210,7 @@ func (lp *LoadPoint) pvMaxCurrent(mode api.ChargeMode, sitePower float64, batter
|
|||
maxCurrent := lp.GetMaxCurrent()
|
||||
|
||||
// switch phases up/down
|
||||
if _, ok := lp.charger.(api.ChargePhases); ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); ok {
|
||||
availablePower := -sitePower + lp.chargePower
|
||||
|
||||
// in case of scaling, keep charger disabled for this cycle
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ func (lp *LoadPoint) GetPhases() int {
|
|||
// SetPhases sets loadpoint enabled phases
|
||||
func (lp *LoadPoint) SetPhases(phases int) error {
|
||||
// limit auto mode (phases=0) to scalable charger
|
||||
if _, ok := lp.charger.(api.ChargePhases); !ok && phases == 0 {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); !ok && phases == 0 {
|
||||
return fmt.Errorf("invalid number of phases: %d", phases)
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ func (lp *LoadPoint) SetPhases(phases int) error {
|
|||
lp.setDefaultPhases(phases)
|
||||
|
||||
// apply immediately if not 1p3p
|
||||
if _, ok := lp.charger.(api.ChargePhases); !ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); !ok {
|
||||
lp.setPhases(phases)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ func (lp *LoadPoint) maxActivePhases() int {
|
|||
}
|
||||
|
||||
// if 1p3p supported then assume configured limit or 3p
|
||||
if _, ok := lp.charger.(api.ChargePhases); ok {
|
||||
if _, ok := lp.charger.(api.PhaseSwitcher); ok {
|
||||
physical = lp.DefaultPhases
|
||||
if physical == 0 {
|
||||
physical = 3
|
||||
|
|
|
|||
|
|
@ -81,9 +81,9 @@ func TestMaxActivePhases(t *testing.T) {
|
|||
plainCharger := mock.NewMockCharger(ctrl)
|
||||
|
||||
// 1p3p
|
||||
var phaseCharger *mock.MockChargePhases
|
||||
var phaseCharger *mock.MockPhaseSwitcher
|
||||
if tc.capable == 0 {
|
||||
phaseCharger = mock.NewMockChargePhases(ctrl)
|
||||
phaseCharger = mock.NewMockPhaseSwitcher(ctrl)
|
||||
}
|
||||
|
||||
vehicle := mock.NewMockVehicle(ctrl)
|
||||
|
|
@ -99,7 +99,7 @@ func TestMaxActivePhases(t *testing.T) {
|
|||
if phaseCharger != nil {
|
||||
lp.charger = struct {
|
||||
*mock.MockCharger
|
||||
*mock.MockChargePhases
|
||||
*mock.MockPhaseSwitcher
|
||||
}{
|
||||
plainCharger, phaseCharger,
|
||||
}
|
||||
|
|
@ -169,9 +169,9 @@ func TestPvScalePhases(t *testing.T) {
|
|||
plainCharger.EXPECT().MaxCurrent(int64(minA)).Return(nil) // MaxCurrentEx not implemented
|
||||
|
||||
// 1p3p
|
||||
var phaseCharger *mock.MockChargePhases
|
||||
var phaseCharger *mock.MockPhaseSwitcher
|
||||
if tc.capable == 0 {
|
||||
phaseCharger = mock.NewMockChargePhases(ctrl)
|
||||
phaseCharger = mock.NewMockPhaseSwitcher(ctrl)
|
||||
}
|
||||
|
||||
vehicle := mock.NewMockVehicle(ctrl)
|
||||
|
|
@ -197,7 +197,7 @@ func TestPvScalePhases(t *testing.T) {
|
|||
if phaseCharger != nil {
|
||||
lp.charger = struct {
|
||||
*mock.MockCharger
|
||||
*mock.MockChargePhases
|
||||
*mock.MockPhaseSwitcher
|
||||
}{
|
||||
plainCharger, phaseCharger,
|
||||
}
|
||||
|
|
@ -261,10 +261,10 @@ func TestPvScalePhasesTimer(t *testing.T) {
|
|||
ctrl := gomock.NewController(t)
|
||||
charger := &struct {
|
||||
*mock.MockCharger
|
||||
*mock.MockChargePhases
|
||||
*mock.MockPhaseSwitcher
|
||||
}{
|
||||
mock.NewMockCharger(ctrl),
|
||||
mock.NewMockChargePhases(ctrl),
|
||||
mock.NewMockPhaseSwitcher(ctrl),
|
||||
}
|
||||
|
||||
dt := time.Minute
|
||||
|
|
@ -365,7 +365,7 @@ func TestPvScalePhasesTimer(t *testing.T) {
|
|||
}
|
||||
|
||||
if tc.res {
|
||||
charger.MockChargePhases.EXPECT().Phases1p3p(tc.toPhases).Return(nil)
|
||||
charger.MockPhaseSwitcher.EXPECT().Phases1p3p(tc.toPhases).Return(nil)
|
||||
}
|
||||
|
||||
res := lp.pvScalePhases(tc.availablePower, minA, maxA)
|
||||
|
|
@ -400,14 +400,14 @@ func TestScalePhasesIfAvailable(t *testing.T) {
|
|||
t.Log(tc)
|
||||
|
||||
plainCharger := mock.NewMockCharger(ctrl)
|
||||
phaseCharger := mock.NewMockChargePhases(ctrl)
|
||||
phaseCharger := mock.NewMockPhaseSwitcher(ctrl)
|
||||
|
||||
lp := &LoadPoint{
|
||||
log: util.NewLogger("foo"),
|
||||
clock: clock.NewMock(),
|
||||
charger: struct {
|
||||
*mock.MockCharger
|
||||
*mock.MockChargePhases
|
||||
*mock.MockPhaseSwitcher
|
||||
}{
|
||||
plainCharger,
|
||||
phaseCharger,
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ func (site *Site) DumpConfig() {
|
|||
_, power := lp.charger.(api.Meter)
|
||||
_, energy := lp.charger.(api.MeterEnergy)
|
||||
_, currents := lp.charger.(api.MeterCurrent)
|
||||
_, phases := lp.charger.(api.ChargePhases)
|
||||
_, phases := lp.charger.(api.PhaseSwitcher)
|
||||
_, wakeup := lp.charger.(api.Resurrector)
|
||||
|
||||
lp.log.INFO.Printf(" charger: power %s energy %s currents %s phases %s wakeup %s",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/evcc-io/evcc/api (interfaces: Charger,ChargeState,ChargePhases,Identifier,Meter,MeterEnergy,Vehicle,ChargeRater,Battery)
|
||||
// Source: github.com/evcc-io/evcc/api (interfaces: Charger,ChargeState,PhaseSwitcher,Identifier,Meter,MeterEnergy,Vehicle,ChargeRater,Battery)
|
||||
|
||||
// Package mock is a generated GoMock package.
|
||||
package mock
|
||||
|
|
@ -130,31 +130,31 @@ func (mr *MockChargeStateMockRecorder) Status() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockChargeState)(nil).Status))
|
||||
}
|
||||
|
||||
// MockChargePhases is a mock of ChargePhases interface.
|
||||
type MockChargePhases struct {
|
||||
// MockPhaseSwitcher is a mock of PhaseSwitcher interface.
|
||||
type MockPhaseSwitcher struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockChargePhasesMockRecorder
|
||||
recorder *MockPhaseSwitcherMockRecorder
|
||||
}
|
||||
|
||||
// MockChargePhasesMockRecorder is the mock recorder for MockChargePhases.
|
||||
type MockChargePhasesMockRecorder struct {
|
||||
mock *MockChargePhases
|
||||
// MockPhaseSwitcherMockRecorder is the mock recorder for MockPhaseSwitcher.
|
||||
type MockPhaseSwitcherMockRecorder struct {
|
||||
mock *MockPhaseSwitcher
|
||||
}
|
||||
|
||||
// NewMockChargePhases creates a new mock instance.
|
||||
func NewMockChargePhases(ctrl *gomock.Controller) *MockChargePhases {
|
||||
mock := &MockChargePhases{ctrl: ctrl}
|
||||
mock.recorder = &MockChargePhasesMockRecorder{mock}
|
||||
// NewMockPhaseSwitcher creates a new mock instance.
|
||||
func NewMockPhaseSwitcher(ctrl *gomock.Controller) *MockPhaseSwitcher {
|
||||
mock := &MockPhaseSwitcher{ctrl: ctrl}
|
||||
mock.recorder = &MockPhaseSwitcherMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockChargePhases) EXPECT() *MockChargePhasesMockRecorder {
|
||||
func (m *MockPhaseSwitcher) EXPECT() *MockPhaseSwitcherMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Phases1p3p mocks base method.
|
||||
func (m *MockChargePhases) Phases1p3p(arg0 int) error {
|
||||
func (m *MockPhaseSwitcher) Phases1p3p(arg0 int) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Phases1p3p", arg0)
|
||||
ret0, _ := ret[0].(error)
|
||||
|
|
@ -162,9 +162,9 @@ func (m *MockChargePhases) Phases1p3p(arg0 int) error {
|
|||
}
|
||||
|
||||
// Phases1p3p indicates an expected call of Phases1p3p.
|
||||
func (mr *MockChargePhasesMockRecorder) Phases1p3p(arg0 interface{}) *gomock.Call {
|
||||
func (mr *MockPhaseSwitcherMockRecorder) Phases1p3p(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Phases1p3p", reflect.TypeOf((*MockChargePhases)(nil).Phases1p3p), arg0)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Phases1p3p", reflect.TypeOf((*MockPhaseSwitcher)(nil).Phases1p3p), arg0)
|
||||
}
|
||||
|
||||
// MockIdentifier is a mock of Identifier interface.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue