Commit 3a69b32
Adapt camera-proxy to new pyro-camera-api client (#569)
* feat: adapt camera-proxy to new pyro-camera-api client
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.
* fix: make speed optional on /control/move_by_degrees
Aligns with the client change where omitting speed lets the server
auto-pick the best calibrated level for the target angle.
* Added direction validation and mark /control/move as deprecated
* style
* fix: deprecate /control/stop as alias of /control/stop_move
Upstream pyro_camera_api implements stop_move as `return stop_camera(camera_ip)`,
so /control/stop and /control/stop_move call the same downstream operation.
Pair the /control/stop deprecation with the existing /control/move deprecation,
and tighten the stop_move summary for OpenAPI clarity.
* refactor: take JSON body on new focused PTZ control endpoints
The five new POSTs introduced in this PR (goto_preset, start_move,
move_for_duration, move_by_degrees, click_to_move) now accept their
operands as a JSON body instead of query parameters. Defines small
Pydantic request models with the same validation constraints
(gt=0, ge=0.0, le=1.0). Tests parametrize updated to send JSON bodies.
POST state-changing commands belong in the body, not the URL — and
since these endpoints are net-new and unreleased, the change is free.
* chore: install pyro-camera-api-client from main
Switch the pyro-camera-api-client git source from the develop branch
to main, and regenerate poetry.lock so the resolved reference picks
up commit 6d525b1 which carries the new focused PTZ client methods
(goto_preset, start_move, stop_move, move_for_duration,
move_by_degrees, click_to_move, get_speed_tables). Unblocks pytest CI.
* fix(client): satisfy stricter types-requests stubs
The latest types-requests release narrowed the expected types for
`headers` (now MutableMapping[str, str | bytes]) and `json` (now
the invariant JsonType). Widen the `headers` property return type
and annotate the heterogeneous occlusion-mask payload accordingly.
Restores green mypy-client CI (red on main since dca6654).
---------
Co-authored-by: fe51 <55736935+fe51@users.noreply.github.com>1 parent dca6654 commit 3a69b32
5 files changed
Lines changed: 212 additions & 50 deletions
File tree
- client/pyroclient
- src
- app/api/api_v1/endpoints
- tests/endpoints
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
24 | 58 | | |
25 | 59 | | |
26 | 60 | | |
| |||
111 | 145 | | |
112 | 146 | | |
113 | 147 | | |
114 | | - | |
| 148 | + | |
115 | 149 | | |
116 | 150 | | |
117 | 151 | | |
| |||
123 | 157 | | |
124 | 158 | | |
125 | 159 | | |
126 | | - | |
| 160 | + | |
127 | 161 | | |
128 | 162 | | |
129 | 163 | | |
| |||
151 | 185 | | |
152 | 186 | | |
153 | 187 | | |
154 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
155 | 191 | | |
156 | 192 | | |
157 | 193 | | |
158 | 194 | | |
159 | 195 | | |
| 196 | + | |
| 197 | + | |
160 | 198 | | |
161 | 199 | | |
162 | 200 | | |
| |||
167 | 205 | | |
168 | 206 | | |
169 | 207 | | |
| 208 | + | |
| 209 | + | |
170 | 210 | | |
171 | 211 | | |
172 | 212 | | |
173 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
174 | 313 | | |
175 | 314 | | |
176 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | | - | |
| 155 | + | |
155 | 156 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
170 | | - | |
171 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
| |||
256 | 268 | | |
257 | 269 | | |
258 | 270 | | |
259 | | - | |
| 271 | + | |
260 | 272 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
280 | 299 | | |
281 | 300 | | |
282 | 301 | | |
| |||
285 | 304 | | |
286 | 305 | | |
287 | 306 | | |
| 307 | + | |
288 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
289 | 312 | | |
290 | | - | |
| 313 | + | |
291 | 314 | | |
0 commit comments