Skip to content

Commit

Permalink
Handle "complete" message, when charging is completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wimaha committed Dec 6, 2024
1 parent 578b373 commit d0eca4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d0eca4b

Please sign in to comment.