Skip to content

Commit

Permalink
Add media toggle playback command
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Terashima authored and sethterashima committed Jan 23, 2024
1 parent fe8c869 commit 8160229
Show file tree
Hide file tree
Showing 6 changed files with 1,112 additions and 1,022 deletions.
9 changes: 9 additions & 0 deletions cmd/tesla-control/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,15 @@ var commands = map[string]*Command{
return car.SetVolume(ctx, float32(volume))
},
},
"media-toggle-playback": &Command{
help: "Toggle between play/pause",
requiresAuth: true,
requiresFleetAPI: false,
args: []Argument{},
handler: func(ctx context.Context, acct *account.Account, car *vehicle.Vehicle, args map[string]string) error {
return car.ToggleMediaPlayback(ctx)
},
},
"software-update-start": &Command{
help: "Start software update after DELAY",
requiresAuth: true,
Expand Down
4 changes: 4 additions & 0 deletions pkg/protocol/protobuf/car_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ message VehicleAction {
HvacSetPreconditioningMaxAction hvacSetPreconditioningMaxAction = 12;
HvacSteeringWheelHeaterAction hvacSteeringWheelHeaterAction = 13;
HvacTemperatureAdjustmentAction hvacTemperatureAdjustmentAction = 14;
MediaPlayAction mediaPlayAction = 15;
MediaUpdateVolume mediaUpdateVolume = 16;
MediaNextFavorite mediaNextFavorite = 17;
MediaPreviousFavorite mediaPreviousFavorite = 18;
Expand Down Expand Up @@ -258,6 +259,9 @@ message Superchargers {
string out_of_order_stalls_names = 20;
}

message MediaPlayAction {
}

message MediaUpdateVolume{
reserved 2;
oneof media_volume {
Expand Down
Loading

0 comments on commit 8160229

Please sign in to comment.