From d0eca4bff4cff3ecd7eb6491a2e8af08d9ac2572 Mon Sep 17 00:00:00 2001 From: Wilko Date: Fri, 6 Dec 2024 14:16:03 +0100 Subject: [PATCH] Handle "complete" message, when charging is completed. --- control/control.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/control/control.go b/control/control.go index ea8abf7..ef51e51 100644 --- a/control/control.go +++ b/control/control.go @@ -303,6 +303,10 @@ func (bc *BleControl) sendCommand(ctx context.Context, car *vehicle.Vehicle, com //The car is already charging, so the command is somehow successfully executed. log.Info("the car is already charging") return false, nil + } else if strings.Contains(err.Error(), "complete") { + //The charging is completed, so the command is somehow successfully executed. + log.Info("the charging is completed") + return false, nil } return true, fmt.Errorf("failed to start charge: %s", err) }