From adf90ecccd44156da4016af7d2d7b1bbf116af81 Mon Sep 17 00:00:00 2001 From: premultiply <4681172+premultiply@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:31:05 +0200 Subject: [PATCH] Ocpp: use ChargingProfileKindAbsolute (#15240) --- charger/ocpp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charger/ocpp.go b/charger/ocpp.go index 6c2a53e27..4e604637d 100644 --- a/charger/ocpp.go +++ b/charger/ocpp.go @@ -452,6 +452,7 @@ func (c *OCPP) getCurrent() (float64, error) { return current, err } +// createTxDefaultChargingProfile returns a TxDefaultChargingProfile with given current func (c *OCPP) createTxDefaultChargingProfile(current float64) *types.ChargingProfile { phases := c.phases period := types.NewChargingSchedulePeriod(0, current) @@ -475,8 +476,9 @@ func (c *OCPP) createTxDefaultChargingProfile(current float64) *types.ChargingPr ChargingProfileId: 0, StackLevel: 0, ChargingProfilePurpose: types.ChargingProfilePurposeTxDefaultProfile, - ChargingProfileKind: types.ChargingProfileKindRelative, + ChargingProfileKind: types.ChargingProfileKindAbsolute, ChargingSchedule: &types.ChargingSchedule{ + StartSchedule: types.Now(), ChargingRateUnit: c.chargingRateUnit, ChargingSchedulePeriod: []types.ChargingSchedulePeriod{period}, },