Tesla: don't treat "completed" as error
Some checks failed
Some checks failed
This commit is contained in:
parent
8d491980d0
commit
191391fc48
1 changed files with 2 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ package vehicle
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/bogosj/tesla"
|
||||
|
|
@ -213,7 +214,7 @@ var _ api.VehicleChargeController = (*Tesla)(nil)
|
|||
// StartCharge implements the api.VehicleChargeController interface
|
||||
func (v *Tesla) StartCharge() error {
|
||||
err := v.apiError(v.vehicle.StartCharging())
|
||||
if err != nil && err.Error() == "is_charging" {
|
||||
if err != nil && slices.Contains([]string{"completed", "is_charging"}, err.Error()) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue