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 missing media commands #356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

patrickdemers6
Copy link
Collaborator

Description

Adds missing media commands to the proxy.

Fixes #345.

Type of change

Please select all options that apply to this change:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Checklist:

Confirm you have completed the following steps:

  • My code follows the style of this project.
  • I have performed a self-review of my code.
  • I have made corresponding updates to the documentation.
  • I have added/updated unit tests to cover my changes.


"github.com/teslamotors/vehicle-command/pkg/protocol/protobuf/carserver"
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move SetVolume, ToggleMediaPlayback here.

})
}

func (v *Vehicle) MediaVolumeRelative(ctx context.Context, delta int32) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the car just looks at the sign of delta. So +10 and +1 do the same thing (increase volume by one unit) and -10 and -1 do the same thing (decrease volume by one unit). So we should probably split this into MediaVolumeUp and MediaVolumeDown, which correspond directly with the REST API.

return func(v *vehicle.Vehicle) error { return v.MediaPreviousTrack(ctx) }, nil
case "media_prev_favorite":
return func(v *vehicle.Vehicle) error { return v.MediaPreviousFavorite(ctx) }, nil
case "media_volume_down", "media_volume_up":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment in media.go.

@sethterashima
Copy link
Collaborator

Can you add the commands to tesla-control as well?

@Lenart12
Copy link
Contributor

I just noticed on https://developer.tesla.com/docs/fleet-api/endpoints/vehicle-commands only media_volume_down is documented, no mention of media_volume_up. Someone should probably contact support :^)

@patrickdemers6
Copy link
Collaborator Author

I just noticed on https://developer.tesla.com/docs/fleet-api/endpoints/vehicle-commands only media_volume_down is documented, no mention of media_volume_up. Someone should probably contact support :^)

That would be me. I've already created a ticket internally to document this.

@liorboyango
Copy link

liorboyango commented Jan 26, 2025

Care to add remote_boombox?
#266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

media_control not work both old and new protocol
5 participants