Adapt camera-proxy to new pyro-camera-api client#569
Conversation
Rename pos_id to patrol_id on /capture, add duration/zoom to legacy /control/move, and expose focused PTZ endpoints (goto_preset, start_move, stop_move, move_for_duration, move_by_degrees, click_to_move) plus /control/speed_tables.
Aligns with the client change where omitting speed lets the server auto-pick the best calibrated level for the target angle.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
==========================================
+ Coverage 88.21% 90.40% +2.18%
==========================================
Files 51 3 -48
Lines 2163 125 -2038
==========================================
- Hits 1908 113 -1795
+ Misses 255 12 -243
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fe51
left a comment
There was a problem hiding this comment.
Hi @MateoLostanlen , I have made small modificaiton as suggestion
- Introduced CameraDirection = Literal["Left", "Right", "Up", "Down"] type alias; applied it to start_move, move_for_duration, and move_by_degrees — invalid directions now return 422 instead of failing downstream
- Added deprecated=True to the /control/move route decorator so it appears struck-through in the OpenAPI docs
Also, I have one question about /control/stop and /control/stop_move
Do these call different downstream methods that have genuinely different scopes? If yes, the summaries should reflect that:
- stop_move → "Halt the current continuous PTZ move" ?
- stop_camera → "Stop all camera activity" (or whatever it actually does) ?
If they turn out to do the same thing, one of them should be removed or at least stop should be deprecated like move.
| summary="Move toward a normalized image click", | ||
| ) | ||
| async def proxy_click_to_move( | ||
| click_x: float = Query(..., ge=0.0, le=1.0, description="Normalized x coordinate in [0, 1]"), |
There was a problem hiding this comment.
Would not be more robust to put x y. in the payload/body instead of a param url ?
Summary
After upted in pyro-camera-api client
to the legacy /control/move.
click_to_move, plus GET /control/speed_tables.