Commit 470888d
authored
Python SDK: Make Cohn feature backwards compatible (#757)
This PR updates the SDK to support legacy COHN protobuf flows by introducing a unified `ProtobufId` identifier, adding support checks via a `require_supported` decorator, and enhancing the response parser and routing to handle unsupported protobuf responses gracefully.
- Introduce `ProtobufId` type and update all parsers/commands to use it
- Add `require_supported` decorator and `is_supported` checks for features
- Extend `BleRespBuilder` and `_route_response` to identify and route unsupported protobuf errors
- Update tests and mocks to cover new unsupported-CoHN behavior
- Bump third-party dependency versions and enable debug logging for response parsing
<details>
<summary>Show a summary per file</summary>
| File | Description |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| demos/python/sdk_wireless_camera_control/thirdPartyDependencies.csv | Bump `packaging` to 25.0 and `protobuf` to 6.31.0 |
| demos/python/sdk_wireless_camera_control/tests/unit/test_wireless_gopro.py | Add unsupported protobuf operation test; update imports |
| demos/python/sdk_wireless_camera_control/tests/unit/test_responses.py | Add and adjust tests for unsupported protobuf responses |
| demos/python/sdk_wireless_camera_control/tests/unit/test_ble_commands.py | Import new `ErrorCode` and `FeatureId` for BLE command tests |
| demos/python/sdk_wireless_camera_control/tests/mocks.py | Extend mocks for protobuf and remove legacy BLE send override |
| demos/python/sdk_wireless_camera_control/open_gopro/util/logger.py | Enable DEBUG logging for `open_gopro.parsers.response` |
| demos/python/sdk_wireless_camera_control/open_gopro/parsers/response.py | Add `validResponseProtobufIds` and handle missing action IDs |
| demos/python/sdk_wireless_camera_control/open_gopro/models/types.py | Introduce `ProtobufId` and update `ResponseType` |
| demos/python/sdk_wireless_camera_control/open_gopro/models/constants/constants.py | Remove deprecated `PROTOBUF_QUERY` enum |
| demos/python/sdk_wireless_camera_control/open_gopro/gopro_wireless.py | Enhance `_route_response` to match unsupported protobuf errors |
| demos/python/sdk_wireless_camera_control/open_gopro/features/base_feature.py | Implement `require_supported` decorator and `is_supported` abstract property |
| demos/python/sdk_wireless_camera_control/open_gopro/features/cohn_feature.py | Add support tracking and guard methods with `require_supported` |
| demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/stream_feature.py | Add `is_supported` property |
| demos/python/sdk_wireless_camera_control/open_gopro/features/access_point_feature.py | Add `is_supported` property |
| demos/python/sdk_wireless_camera_control/open_gopro/api/builders.py | Update `BleProtoCommand` to use `ProtobufId` |
| demos/python/sdk_wireless_camera_control/open_gopro/api/ble_commands.py | Update protobuf commands to use `ProtobufId` in `additional_matching_ids` |
</details>1 parent a78269b commit 470888d
File tree
23 files changed
+599
-312
lines changed- demos/python/sdk_wireless_camera_control
- open_gopro
- api
- demos/gui
- features
- streaming
- models
- constants
- parsers
- util
- tests
- unit
23 files changed
+599
-312
lines changedLines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 309 | + | |
312 | 310 | | |
313 | 311 | | |
314 | 312 | | |
| |||
430 | 428 | | |
431 | 429 | | |
432 | 430 | | |
433 | | - | |
| 431 | + | |
434 | 432 | | |
435 | 433 | | |
436 | 434 | | |
| |||
559 | 557 | | |
560 | 558 | | |
561 | 559 | | |
562 | | - | |
| 560 | + | |
563 | 561 | | |
564 | 562 | | |
565 | 563 | | |
| |||
580 | 578 | | |
581 | 579 | | |
582 | 580 | | |
583 | | - | |
| 581 | + | |
584 | 582 | | |
585 | 583 | | |
586 | 584 | | |
| |||
666 | 664 | | |
667 | 665 | | |
668 | 666 | | |
669 | | - | |
| 667 | + | |
670 | 668 | | |
671 | 669 | | |
672 | 670 | | |
| |||
694 | 692 | | |
695 | 693 | | |
696 | 694 | | |
| 695 | + | |
697 | 696 | | |
698 | 697 | | |
699 | 698 | | |
| |||
819 | 818 | | |
820 | 819 | | |
821 | 820 | | |
822 | | - | |
| 821 | + | |
823 | 822 | | |
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
381 | | - | |
| 382 | + | |
382 | 383 | | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
400 | | - | |
| 402 | + | |
401 | 403 | | |
402 | 404 | | |
403 | 405 | | |
| |||
888 | 890 | | |
889 | 891 | | |
890 | 892 | | |
| 893 | + | |
891 | 894 | | |
892 | 895 | | |
893 | 896 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
37 | | - | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
| 56 | + | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
| 60 | + | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
Lines changed: 61 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | | - | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | | - | |
14 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
18 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
20 | 35 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
28 | 55 | | |
29 | 56 | | |
30 | 57 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 58 | + | |
| 59 | + | |
35 | 60 | | |
36 | 61 | | |
37 | 62 | | |
38 | 63 | | |
39 | 64 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
43 | 85 | | |
44 | 86 | | |
45 | 87 | | |
| |||
0 commit comments