Skip to content

Adapt camera-proxy to new pyro-camera-api client#569

Open
MateoLostanlen wants to merge 4 commits into
mainfrom
update_camera_proxy
Open

Adapt camera-proxy to new pyro-camera-api client#569
MateoLostanlen wants to merge 4 commits into
mainfrom
update_camera_proxy

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

Summary

After upted in pyro-camera-api client

  • Aligns /cameras/{id}/... proxy routes with the refreshed pyro_camera_api_client: renames pos_id → patrol_id on /capture, and adds duration / zoom
    to the legacy /control/move.
  • Exposes the new focused PTZ endpoints (preferred over the overloaded move): goto_preset, start_move, stop_move, move_for_duration, move_by_degrees,
    click_to_move, plus GET /control/speed_tables.
  • speed on /control/move_by_degrees is optional — when omitted the device auto-picks the best calibrated speed (preferred).
  • Temporarily pins pyro-camera-api-client to the calibrate_reolink_cam branch until those client changes land on develop; switch back before merge.

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.
@MateoLostanlen MateoLostanlen requested a review from fe51 April 16, 2026 11:38
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.40%. Comparing base (0790626) to head (5678ccb).
⚠️ Report is 13 commits behind head on main.

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     
Flag Coverage Δ
backend ?
client 90.40% <ø> (+2.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@fe51 fe51 left a comment

Choose a reason for hiding this comment

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

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]"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would not be more robust to put x y. in the payload/body instead of a param url ?

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.

2 participants