Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add batch remove charge/precondition schedule to http proxy #311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions pkg/proxy/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,34 @@ func ExtractCommandAction(ctx context.Context, command string, params RequestPar
return nil, err
}
return func(v *vehicle.Vehicle) error { return v.RemovePreconditionSchedule(ctx, uint64(id)) }, nil
case "batch_remove_charge_schedules":
home, err := params.getBool("home", false)
if err != nil {
return nil, err
}
work, err := params.getBool("work", false)
if err != nil {
return nil, err
}
other, err := params.getBool("other", false)
if err != nil {
return nil, err
}
return func(v *vehicle.Vehicle) error { return v.BatchRemoveChargeSchedules(ctx, home, work, other) }, nil
case "batch_remove_precondition_schedules":
home, err := params.getBool("home", false)
if err != nil {
return nil, err
}
work, err := params.getBool("work", false)
if err != nil {
return nil, err
}
other, err := params.getBool("other", false)
if err != nil {
return nil, err
}
return func(v *vehicle.Vehicle) error { return v.BatchRemovePreconditionSchedules(ctx, home, work, other) }, nil
case "set_managed_charge_current_request":
return nil, ErrCommandUseRESTAPI
case "set_managed_charger_location":
Expand Down
Loading