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

Python SDK is using enum name instead of value for Set Setting Endpoint #400

Closed
tony-gutierrez opened this issue Sep 21, 2023 · 6 comments · Fixed by #402
Closed

Python SDK is using enum name instead of value for Set Setting Endpoint #400

tony-gutierrez opened this issue Sep 21, 2023 · 6 comments · Fixed by #402
Assignees
Labels
bug Something isn't working demos Relating to demos

Comments

@tony-gutierrez
Copy link

Component
What is the bug in?

  • python sdk

Describe the bug
The sdk is resulting in http command like:
http://172.28.151.51:8080/gopro/camera/setting?setting=162&option=MaxLensMode.DEFAULT
instead of:
http://172.28.151.51:8080/gopro/camera/setting?setting=162&option=0

To Reproduce
Steps to reproduce the behavior:

  1. Run the video demo with logging level set to DEBUG with cam connected to USB
  2. Observe the URLs called

Expected behavior
Correct url

Hardware

  • Camera: Hero11 black
  • Desktop if applicable MAC
@tony-gutierrez tony-gutierrez added the bug Something isn't working label Sep 21, 2023
@tony-gutierrez
Copy link
Author

Looks like this fixes the issue

bug

@tony-gutierrez
Copy link
Author

@tcamise-gpsw

@tcamise-gpsw tcamise-gpsw self-assigned this Sep 21, 2023
@tcamise-gpsw
Copy link
Collaborator

Thanks, this really should not have slipped by. Let me add some unit testing for regression and open a PR

@tcamise-gpsw tcamise-gpsw added the demos Relating to demos label Sep 21, 2023
@tcamise-gpsw tcamise-gpsw changed the title SDK is sending the param name instead of the param value?? Python SDK is using enum name instead of value for Set Setting Endpoint Sep 21, 2023
@tony-gutierrez
Copy link
Author

It seems like with a bad value, the camera returns a 400, empty {}. With a good value but invalid, it returns a 403 with some JSON:

{
	"error": 2,
	"setting_id": 173
}

I discovered this as the Hero 11 does not seem to support this setting in the video.py demo (at least while on usb):
await gopro.http_setting.video_performance_mode.set(Params.PerformanceMode.MAX_PERFORMANCE)
http://172.28.151.51:8080/gopro/camera/setting?setting=173&option=0

@tcamise-gpsw
Copy link
Collaborator

tcamise-gpsw commented Sep 21, 2023

Yeah the SDK does not make an effort to know which settings are supported on which cameras / FW. That's why the demos don't assert on the status of these commands. The result of this is that settings are only set for the relevant firmware versions where this setting mattered; and rejected otherwise

@tcamise-gpsw tcamise-gpsw linked a pull request Sep 21, 2023 that will close this issue
@tcamise-gpsw
Copy link
Collaborator

I just merged a PR to fix this. I will release 0.14.1 which will include this and other fixes now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working demos Relating to demos
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants