Skip to content

Commit

Permalink
Merge pull request #61 from wimaha/dev
Browse files Browse the repository at this point in the history
Handle "complete" message, when charging is completed.
  • Loading branch information
wimaha authored Dec 6, 2024
2 parents 578b373 + d0eca4b commit f0d705d
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 f0d705d

Please sign in to comment.