diff --git a/charger/bender.go b/charger/bender.go index 6f4b116e75..b02fac53d8 100644 --- a/charger/bender.go +++ b/charger/bender.go @@ -43,26 +43,28 @@ type BenderCC struct { const ( // all holding type registers - bendRegChargePointState = 122 // Vehicle (Control Pilot) state - bendRegPhaseEnergy = 200 // Phase energy from primary meter (Wh) - bendRegCurrents = 212 // Currents from primary meter (mA) - bendRegTotalEnergy = 218 // Total Energy from primary meter (Wh) - bendRegActivePower = 220 // Active Power from primary meter (W) - bendRegVoltages = 222 // Voltages of the ocpp meter (V) - bendRegChargedEnergyLegacy = 705 // Sum of charged energy for the current session (Wh) - bendRegChargingDurationLegacy = 709 // Duration since beginning of charge (Seconds) - bendRegChargedEnergy = 716 // Sum of charged energy for the current session (Wh) - bendRegChargingDuration = 718 // Duration since beginning of charge (Seconds) - bendRegUserID = 720 // User ID (OCPP IdTag) from the current session. Bytes 0 to 19. - bendRegEVBatteryState = 730 // EV Battery State (% 0-100) - bendRegEVCCID = 741 // ASCII representation of the Hex. Values corresponding to the EVCCID. Bytes 0 to 11. - bendRegHemsCurrentLimit = 1000 // Current limit of the HEMS module (A) + bendRegChargePointState = 122 // Vehicle (Control Pilot) state + bendRegPhaseEnergy = 200 // Phase energy from primary meter (Wh) + bendRegCurrents = 212 // Currents from primary meter (mA) + bendRegTotalEnergy = 218 // Total Energy from primary meter (Wh) + bendRegActivePower = 220 // Active Power from primary meter (W) + bendRegVoltages = 222 // Voltages of the ocpp meter (V) + bendRegUserID = 720 // User ID (OCPP IdTag) from the current session. Bytes 0 to 19. + bendRegEVBatteryState = 730 // EV Battery State (% 0-100) + bendRegEVCCID = 741 // ASCII representation of the Hex. Values corresponding to the EVCCID. Bytes 0 to 11. + bendRegHemsCurrentLimit = 1000 // Current limit of the HEMS module (A) bendRegFirmware = 100 // Application version number bendRegOcppCpStatus = 104 // Charge Point status according to the OCPP spec. enumaration bendRegProtocolVersion = 120 // Ebee Modbus TCP Server Protocol Version number bendRegChargePointModel = 142 // ChargePoint Model. Bytes 0 to 19. bendRegSmartVehicleDetected = 740 // Returns 1 if an EV currently connected is a smart vehicle, or 0 if no EV connected or it is not a smart vehicle + + // unused + // bendRegChargedEnergyLegacy = 705 // Sum of charged energy for the current session (Wh) + // bendRegChargingDurationLegacy = 709 // Duration since beginning of charge (Seconds) + // bendRegChargedEnergy = 716 // Sum of charged energy for the current session (Wh) + // bendRegChargingDuration = 718 // Duration since beginning of charge (Seconds) ) func init() { @@ -82,7 +84,7 @@ func NewBenderCCFromConfig(other map[string]interface{}) (api.Charger, error) { return NewBenderCC(cc.URI, cc.ID) } -//go:generate go run ../cmd/tools/decorate.go -f decorateBenderCC -b *BenderCC -r api.Charger -t "api.Meter,CurrentPower,func() (float64, error)" -t "api.PhaseCurrents,Currents,func() (float64, float64, float64, error)" -t "api.PhaseVoltages,Voltages,func() (float64, float64, float64, error)" -t "api.ChargeRater,ChargedEnergy,func() (float64, error)" -t "api.MeterEnergy,TotalEnergy,func() (float64, error)" -t "api.Battery,Soc,func() (float64, error)" -t "api.Identifier,Identify,func() (string, error)" +//go:generate go run ../cmd/tools/decorate.go -f decorateBenderCC -b *BenderCC -r api.Charger -t "api.Meter,CurrentPower,func() (float64, error)" -t "api.PhaseCurrents,Currents,func() (float64, float64, float64, error)" -t "api.PhaseVoltages,Voltages,func() (float64, float64, float64, error)" -t "api.MeterEnergy,TotalEnergy,func() (float64, error)" -t "api.Battery,Soc,func() (float64, error)" -t "api.Identifier,Identify,func() (string, error)" // NewBenderCC creates BenderCC charger func NewBenderCC(uri string, id uint8) (api.Charger, error) { @@ -109,13 +111,12 @@ func NewBenderCC(uri string, id uint8) (api.Charger, error) { } var ( - currentPower func() (float64, error) - currents func() (float64, float64, float64, error) - voltages func() (float64, float64, float64, error) - chargedEnergy func() (float64, error) - totalEnergy func() (float64, error) - soc func() (float64, error) - identify func() (string, error) + currentPower func() (float64, error) + currents func() (float64, float64, float64, error) + voltages func() (float64, float64, float64, error) + totalEnergy func() (float64, error) + soc func() (float64, error) + identify func() (string, error) ) // check presence of metering @@ -127,7 +128,6 @@ func NewBenderCC(uri string, id uint8) (api.Charger, error) { if b, err := wb.conn.ReadHoldingRegisters(reg, 2); err == nil && binary.BigEndian.Uint32(b) != math.MaxUint32 { currentPower = wb.currentPower currents = wb.currents - chargedEnergy = wb.chargedEnergy totalEnergy = wb.totalEnergy // check presence of "ocpp meter" @@ -147,7 +147,7 @@ func NewBenderCC(uri string, id uint8) (api.Charger, error) { identify = wb.identify } - return decorateBenderCC(wb, currentPower, currents, voltages, chargedEnergy, totalEnergy, soc, identify), nil + return decorateBenderCC(wb, currentPower, currents, voltages, totalEnergy, soc, identify), nil } // Status implements the api.Charger interface @@ -226,24 +226,8 @@ func (wb *BenderCC) currentPower() (float64, error) { return float64(binary.BigEndian.Uint32(b)), nil } -// ChargedEnergy implements the api.ChargeRater interface -func (wb *BenderCC) chargedEnergy() (float64, error) { - if wb.legacy { - b, err := wb.conn.ReadHoldingRegisters(bendRegChargedEnergyLegacy, 1) - if err != nil { - return 0, err - } - - return float64(binary.BigEndian.Uint16(b)) / 1e3, nil - } - - b, err := wb.conn.ReadHoldingRegisters(bendRegChargedEnergy, 2) - if err != nil { - return 0, err - } - - return float64(binary.BigEndian.Uint32(b)) / 1e3, nil -} +// removed: https://github.com/evcc-io/evcc/issues/13726 +// var _ api.ChargeRater = (*BenderCC)(nil) // TotalEnergy implements the api.MeterEnergy interface func (wb *BenderCC) totalEnergy() (float64, error) { diff --git a/charger/bender_decorators.go b/charger/bender_decorators.go index 2deb14b449..86097d84fb 100644 --- a/charger/bender_decorators.go +++ b/charger/bender_decorators.go @@ -6,12 +6,12 @@ import ( "github.com/evcc-io/evcc/api" ) -func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurrents func() (float64, float64, float64, error), phaseVoltages func() (float64, float64, float64, error), chargeRater func() (float64, error), meterEnergy func() (float64, error), battery func() (float64, error), identifier func() (string, error)) api.Charger { +func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurrents func() (float64, float64, float64, error), phaseVoltages func() (float64, float64, float64, error), meterEnergy func() (float64, error), battery func() (float64, error), identifier func() (string, error)) api.Charger { switch { - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return base - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Meter @@ -22,7 +22,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.PhaseCurrents @@ -33,7 +33,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Meter @@ -48,7 +48,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.PhaseVoltages @@ -59,7 +59,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.Meter @@ -74,7 +74,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.PhaseCurrents @@ -89,7 +89,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.Meter @@ -108,304 +108,24 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Meter - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.PhaseCurrents - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Meter - api.PhaseCurrents - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Meter - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Meter - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.MeterEnergy - }{ - BenderCC: base, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Meter - api.MeterEnergy - }{ - BenderCC: base, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Meter - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Meter - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Meter - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.MeterEnergy }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, }, } - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater api.Meter api.MeterEnergy }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, @@ -414,17 +134,13 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, }, @@ -433,18 +149,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater api.Meter api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, @@ -456,17 +168,13 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, }, @@ -475,18 +183,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater api.Meter api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, @@ -498,18 +202,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, }, @@ -521,19 +221,15 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater api.Meter api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, @@ -548,7 +244,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery @@ -559,7 +255,7 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery @@ -574,1088 +270,84 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery api.PhaseCurrents }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.MeterEnergy - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.MeterEnergy - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater == nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.Meter - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.MeterEnergy - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.MeterEnergy - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.MeterEnergy - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery != nil && chargeRater != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Battery - api.ChargeRater - api.Meter - api.MeterEnergy - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.Meter - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.PhaseCurrents - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.Meter - api.PhaseCurrents - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Identifier - api.PhaseVoltages - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Identifier - api.Meter - api.PhaseVoltages - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Identifier - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.Identifier - api.Meter - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.Meter - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.PhaseCurrents - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.Meter - api.PhaseCurrents - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.Meter - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: - return &struct { - *BenderCC - api.ChargeRater - api.Identifier - api.Meter - api.PhaseCurrents - api.PhaseVoltages - }{ - BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ - phaseCurrents: phaseCurrents, - }, - PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ - phaseVoltages: phaseVoltages, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.MeterEnergy - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.Meter - api.MeterEnergy - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - Meter: &decorateBenderCCMeterImpl{ - meter: meter, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, - } - - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: - return &struct { - *BenderCC - api.Identifier - api.MeterEnergy - api.PhaseCurrents - }{ - BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.Identifier + api.Battery api.Meter - api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Identifier - api.MeterEnergy + api.Battery api.PhaseVoltages }{ BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Identifier + api.Battery api.Meter - api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery == nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Identifier - api.MeterEnergy + api.Battery api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, - }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, @@ -1665,25 +357,21 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Identifier + api.Battery api.Meter - api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, @@ -1692,39 +380,31 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.MeterEnergy }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, }, } - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.Meter api.MeterEnergy }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, @@ -1734,20 +414,16 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, @@ -1757,21 +433,17 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.Meter api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, @@ -1784,20 +456,16 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, @@ -1807,21 +475,17 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.Meter api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, @@ -1834,21 +498,17 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, MeterEnergy: &decorateBenderCCMeterEnergyImpl{ meterEnergy: meterEnergy, @@ -1861,22 +521,18 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery == nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier == nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.ChargeRater - api.Identifier + api.Battery api.Meter api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, - Identifier: &decorateBenderCCIdentifierImpl{ - identifier: identifier, + Battery: &decorateBenderCCBatteryImpl{ + battery: battery, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, @@ -1892,32 +548,24 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery api.Identifier }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery api.Identifier api.Meter }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -1926,17 +574,13 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery api.Identifier api.PhaseCurrents }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -1945,18 +589,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery api.Identifier api.Meter api.PhaseCurrents }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -1968,17 +608,13 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery api.Identifier api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -1987,18 +623,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery api.Identifier api.Meter api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2010,18 +642,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery api.Identifier api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2033,19 +661,15 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery api.Identifier api.Meter api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2060,167 +684,139 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier + api.MeterEnergy }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier api.Meter + api.MeterEnergy }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier + api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier api.Meter + api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier + api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier api.Meter + api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier + api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, @@ -2229,29 +825,25 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: + case battery == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC - api.Battery - api.ChargeRater api.Identifier api.Meter + api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ BenderCC: base, - Battery: &decorateBenderCCBatteryImpl{ - battery: battery, - }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, Meter: &decorateBenderCCMeterImpl{ meter: meter, }, + MeterEnergy: &decorateBenderCCMeterEnergyImpl{ + meterEnergy: meterEnergy, + }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, @@ -2260,12 +852,11 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery api.Identifier - api.MeterEnergy }{ BenderCC: base, Battery: &decorateBenderCCBatteryImpl{ @@ -2274,18 +865,14 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery api.Identifier api.Meter - api.MeterEnergy }{ BenderCC: base, Battery: &decorateBenderCCBatteryImpl{ @@ -2297,17 +884,13 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery api.Identifier - api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, @@ -2317,21 +900,17 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery api.Identifier api.Meter - api.MeterEnergy api.PhaseCurrents }{ BenderCC: base, @@ -2344,20 +923,16 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery api.Identifier - api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, @@ -2367,21 +942,17 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery api.Identifier api.Meter - api.MeterEnergy api.PhaseVoltages }{ BenderCC: base, @@ -2394,20 +965,16 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseVoltages: &decorateBenderCCPhaseVoltagesImpl{ phaseVoltages: phaseVoltages, }, } - case battery != nil && chargeRater == nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery api.Identifier - api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ @@ -2418,9 +985,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, @@ -2429,13 +993,12 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater == nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy == nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery api.Identifier api.Meter - api.MeterEnergy api.PhaseCurrents api.PhaseVoltages }{ @@ -2449,9 +1012,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Meter: &decorateBenderCCMeterImpl{ meter: meter, }, - MeterEnergy: &decorateBenderCCMeterEnergyImpl{ - meterEnergy: meterEnergy, - }, PhaseCurrents: &decorateBenderCCPhaseCurrentsImpl{ phaseCurrents: phaseCurrents, }, @@ -2460,11 +1020,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.MeterEnergy }{ @@ -2472,9 +1031,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2483,11 +1039,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.Meter api.MeterEnergy @@ -2496,9 +1051,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2510,11 +1062,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.MeterEnergy api.PhaseCurrents @@ -2523,9 +1074,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2537,11 +1085,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages == nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.Meter api.MeterEnergy @@ -2551,9 +1098,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2568,11 +1112,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.MeterEnergy api.PhaseVoltages @@ -2581,9 +1124,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2595,11 +1135,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents == nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.Meter api.MeterEnergy @@ -2609,9 +1148,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2626,11 +1162,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter == nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.MeterEnergy api.PhaseCurrents @@ -2640,9 +1175,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2657,11 +1189,10 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren }, } - case battery != nil && chargeRater != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: + case battery != nil && identifier != nil && meter != nil && meterEnergy != nil && phaseCurrents != nil && phaseVoltages != nil: return &struct { *BenderCC api.Battery - api.ChargeRater api.Identifier api.Meter api.MeterEnergy @@ -2672,9 +1203,6 @@ func decorateBenderCC(base *BenderCC, meter func() (float64, error), phaseCurren Battery: &decorateBenderCCBatteryImpl{ battery: battery, }, - ChargeRater: &decorateBenderCCChargeRaterImpl{ - chargeRater: chargeRater, - }, Identifier: &decorateBenderCCIdentifierImpl{ identifier: identifier, }, @@ -2704,14 +1232,6 @@ func (impl *decorateBenderCCBatteryImpl) Soc() (float64, error) { return impl.battery() } -type decorateBenderCCChargeRaterImpl struct { - chargeRater func() (float64, error) -} - -func (impl *decorateBenderCCChargeRaterImpl) ChargedEnergy() (float64, error) { - return impl.chargeRater() -} - type decorateBenderCCIdentifierImpl struct { identifier func() (string, error) } diff --git a/charger/fronius-wattpilot.go b/charger/fronius-wattpilot.go index 2a39cf0158..994e3f73a0 100644 --- a/charger/fronius-wattpilot.go +++ b/charger/fronius-wattpilot.go @@ -100,16 +100,8 @@ func (c *Wattpilot) CurrentPower() (float64, error) { return c.api.GetPower() } -var _ api.ChargeRater = (*Wattpilot)(nil) - -// ChargedEnergy implements the api.ChargeRater interface -func (c *Wattpilot) ChargedEnergy() (float64, error) { - resp, err := c.api.GetProperty("wh") - if err != nil { - return 0, err - } - return resp.(float64) / 1e3, err -} +// removed: https://github.com/evcc-io/evcc/issues/13726 +// var _ api.ChargeRater = (*Wattpilot)(nil) var _ api.PhaseCurrents = (*Wattpilot)(nil) diff --git a/charger/go-e.go b/charger/go-e.go index 02fbaf5c21..b920f42e97 100644 --- a/charger/go-e.go +++ b/charger/go-e.go @@ -149,17 +149,8 @@ func (c *GoE) CurrentPower() (float64, error) { return resp.CurrentPower(), err } -var _ api.ChargeRater = (*GoE)(nil) - -// ChargedEnergy implements the api.ChargeRater interface -func (c *GoE) ChargedEnergy() (float64, error) { - resp, err := c.api.Status() - if err != nil { - return 0, err - } - - return resp.ChargedEnergy(), err -} +// removed: https://github.com/evcc-io/evcc/issues/13726 +// var _ api.ChargeRater = (*GoE)(nil) var _ api.PhaseCurrents = (*GoE)(nil)