ActionStreamer 1.4.8__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. actionstreamer-2.0.0/PKG-INFO +51 -0
  2. actionstreamer-2.0.0/README.md +31 -0
  3. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/CommonFunctions/common_functions.py +8 -51
  4. actionstreamer-2.0.0/actionstreamer/CommonFunctions/hmac_signature.py +44 -0
  5. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Config/config.py +12 -2
  6. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/DeviceHealthFunctions/device_health_functions.py +1494 -1433
  7. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/__init__.py +9 -9
  8. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/create_video_clip.py +7 -1
  9. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/device.py +3 -0
  10. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/device_health_row.py +21 -10
  11. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_type.py +8 -2
  12. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/file.py +7 -1
  13. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/item_type.py +0 -1
  14. actionstreamer-2.0.0/actionstreamer/Model/moq_conference_event_parameters.py +34 -0
  15. actionstreamer-2.0.0/actionstreamer/Model/moq_publish_event_parameters.py +21 -0
  16. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/recording_args.py +7 -1
  17. actionstreamer-2.0.0/actionstreamer/Model/srt_args.py +88 -0
  18. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/srt_publish_credential.py +22 -6
  19. actionstreamer-2.0.0/actionstreamer/Model/user_status.py +7 -0
  20. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/video_clip.py +7 -1
  21. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/__init__.py +2 -5
  22. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Agent/agent.py +5 -1
  23. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/AudioClip/audio_clip.py +15 -4
  24. actionstreamer-2.0.0/actionstreamer/WebService/Auth/__init__.py +4 -0
  25. actionstreamer-2.0.0/actionstreamer/WebService/Auth/auth.py +80 -0
  26. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Caption/caption.py +6 -2
  27. actionstreamer-2.0.0/actionstreamer/WebService/Device/__init__.py +4 -0
  28. actionstreamer-2.0.0/actionstreamer/WebService/Device/device.py +367 -0
  29. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/DeviceHealth/device_health.py +19 -4
  30. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Event/event.py +20 -5
  31. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/File/file.py +18 -4
  32. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Image/image.py +9 -2
  33. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/LogMessage/log_message.py +5 -1
  34. actionstreamer-2.0.0/actionstreamer/WebService/Moq/__init__.py +4 -0
  35. actionstreamer-2.0.0/actionstreamer/WebService/Moq/managed.py +13 -0
  36. actionstreamer-2.0.0/actionstreamer/WebService/Moq/moq.py +306 -0
  37. actionstreamer-2.0.0/actionstreamer/WebService/Moq/subscribe.py +45 -0
  38. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Tag/tag.py +5 -1
  39. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/VideoClip/video_clip.py +15 -4
  40. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/__init__.py +1 -2
  41. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/pyproject.toml +1 -1
  42. actionstreamer-1.4.8/PKG-INFO +0 -23
  43. actionstreamer-1.4.8/README.md +0 -3
  44. actionstreamer-1.4.8/actionstreamer/Model/create_stream.py +0 -66
  45. actionstreamer-1.4.8/actionstreamer/Model/srt_args.py +0 -59
  46. actionstreamer-1.4.8/actionstreamer/Model/stream.py +0 -93
  47. actionstreamer-1.4.8/actionstreamer/Model/stream_type.py +0 -12
  48. actionstreamer-1.4.8/actionstreamer/Result/stream_result.py +0 -16
  49. actionstreamer-1.4.8/actionstreamer/WebService/Auth/__init__.py +0 -4
  50. actionstreamer-1.4.8/actionstreamer/WebService/Auth/auth.py +0 -48
  51. actionstreamer-1.4.8/actionstreamer/WebService/Device/__init__.py +0 -4
  52. actionstreamer-1.4.8/actionstreamer/WebService/Device/device.py +0 -213
  53. actionstreamer-1.4.8/actionstreamer/WebService/Stream/__init__.py +0 -4
  54. actionstreamer-1.4.8/actionstreamer/WebService/Stream/stream.py +0 -81
  55. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/CommonFunctions/Wifi/__init__.py +0 -0
  56. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/CommonFunctions/Wifi/wifi.py +0 -0
  57. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/CommonFunctions/__init__.py +0 -0
  58. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Config/__init__.py +0 -0
  59. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/DeviceFunctions/__init__.py +0 -0
  60. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/DeviceFunctions/device_functions.py +0 -0
  61. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/DeviceHealthFunctions/__init__.py +0 -0
  62. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/agent_type.py +0 -0
  63. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/audio_clip.py +0 -0
  64. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/camera_multiplex_args.py +0 -0
  65. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/capture_frames_args.py +0 -0
  66. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/capture_photo_args.py +0 -0
  67. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/clear_flag_queue_args.py +0 -0
  68. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/collection_base.py +0 -0
  69. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/concatenate_clips_args.py +0 -0
  70. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/conference_args.py +0 -0
  71. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/create_audio_clip.py +0 -0
  72. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/create_event_preset.py +0 -0
  73. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/create_image.py +0 -0
  74. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/date_time_encoder.py +0 -0
  75. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/device_group.py +0 -0
  76. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/device_health.py +0 -0
  77. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/epoch_range.py +0 -0
  78. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event.py +0 -0
  79. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_args.py +0 -0
  80. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_details.py +0 -0
  81. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_preset.py +0 -0
  82. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_preset_workflow_args.py +0 -0
  83. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_status.py +0 -0
  84. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/event_with_names.py +0 -0
  85. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/file_status.py +0 -0
  86. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/image.py +0 -0
  87. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/log_message.py +0 -0
  88. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/microphone_multiplex_args.py +0 -0
  89. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/multiplex_conference_args.py +0 -0
  90. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/multiplex_leave_conference_args.py +0 -0
  91. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/multiplex_recording_args.py +0 -0
  92. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/multiplex_stop_recording_args.py +0 -0
  93. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/name_value_pair.py +0 -0
  94. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/notification.py +0 -0
  95. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/package.py +0 -0
  96. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/patch_operation.py +0 -0
  97. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/receive_actionync_args.py +0 -0
  98. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/receive_udp_audio_args.py +0 -0
  99. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/receive_udp_video_args.py +0 -0
  100. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/record_audio_args.py +0 -0
  101. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/rtmp_args.py +0 -0
  102. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/send_actionsync_args.py +0 -0
  103. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/send_udp_audio_args.py +0 -0
  104. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/send_udp_video_args.py +0 -0
  105. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/stop_receive_actionsync_args.py +0 -0
  106. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/stop_receive_udp_audio_args.py +0 -0
  107. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/stop_receive_udp_video_args.py +0 -0
  108. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/tag.py +0 -0
  109. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/tag_list_for_device_list.py +0 -0
  110. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/token.py +0 -0
  111. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/transcoding_args.py +0 -0
  112. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/transfer_args.py +0 -0
  113. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/video_clip_status.py +0 -0
  114. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/video_clip_type.py +0 -0
  115. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/web_service_result.py +0 -0
  116. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/wifi_connection.py +0 -0
  117. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Model/workflow_preset.py +0 -0
  118. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/audio_clip_result.py +0 -0
  119. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/device_group_result.py +0 -0
  120. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/device_health_result.py +0 -0
  121. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/device_health_row_result.py +0 -0
  122. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/device_result.py +0 -0
  123. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/event_preset_result.py +0 -0
  124. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/event_result.py +0 -0
  125. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/event_with_names_result.py +0 -0
  126. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/file_result.py +0 -0
  127. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/image_result.py +0 -0
  128. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/integer_result.py +0 -0
  129. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/log_message_result.py +0 -0
  130. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/notification_result.py +0 -0
  131. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/package_result.py +0 -0
  132. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/srt_publish_credential_result.py +0 -0
  133. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/standard_result.py +0 -0
  134. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/token_result.py +0 -0
  135. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/Result/video_clip_result.py +0 -0
  136. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Agent/__init__.py +0 -0
  137. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/AudioClip/__init__.py +0 -0
  138. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Caption/__init__.py +0 -0
  139. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/DeviceGroup/__init__.py +0 -0
  140. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/DeviceGroup/device_group.py +0 -0
  141. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/DeviceHealth/__init__.py +0 -0
  142. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Event/__init__.py +0 -0
  143. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/EventPreset/__init__.py +0 -0
  144. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/EventPreset/event_preset.py +0 -0
  145. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/File/__init__.py +0 -0
  146. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Image/__init__.py +0 -0
  147. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/LogMessage/__init__.py +0 -0
  148. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Notification/__init__.py +0 -0
  149. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Notification/notification.py +0 -0
  150. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Package/__init__.py +0 -0
  151. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Package/package.py +0 -0
  152. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Patch/__init__.py +0 -0
  153. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Patch/patch.py +0 -0
  154. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Session/__init__.py +0 -0
  155. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Session/session.py +0 -0
  156. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Setting/__init__.py +0 -0
  157. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Setting/setting.py +0 -0
  158. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Tag/__init__.py +0 -0
  159. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Token/__init__.py +0 -0
  160. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/Token/token.py +0 -0
  161. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/WebService/VideoClip/__init__.py +0 -0
  162. {actionstreamer-1.4.8 → actionstreamer-2.0.0}/actionstreamer/__init__.py +0 -0
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.1
2
+ Name: actionstreamer
3
+ Version: 2.0.0
4
+ Summary: A library for the ActionStreamer API.
5
+ Author: ActionStreamer
6
+ Author-email: joe@actionstreamer.com
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: keyring (>=25.7.0)
13
+ Requires-Dist: psutil (>=6.0.0)
14
+ Requires-Dist: pycryptodome (>=3.23.0)
15
+ Requires-Dist: pytz (>=2024.1,<2025.0)
16
+ Requires-Dist: requests (>=2.33.0,<3.0.0)
17
+ Requires-Dist: wmi (>=1.5.1,<2.0.0) ; sys_platform == "win32"
18
+ Description-Content-Type: text/markdown
19
+
20
+ # ActionStreamer
21
+
22
+ A Python library for the ActionStreamer API.
23
+
24
+ ## Version 2 compatibility
25
+
26
+ Version 2 removes the obsolete Stream API, Stream models and Stream result
27
+ types. Source and StreamSession APIs are not replacements for those legacy
28
+ calls. Applications that still require Stream should pin the published
29
+ `actionstreamer==1.4.8` release until migrated.
30
+
31
+ The checked-in version is a development base, not a release. Build local
32
+ development artifacts with `python build_dev.py`; their version includes a
33
+ source fingerprint. Do not publish those artifacts as a release.
34
+
35
+ ## Device identity
36
+
37
+ Resolve an existing Device by its logical UUID once after authentication, then use its DeviceID for operations:
38
+
39
+ ```python
40
+ from actionstreamer.WebService import Device, VideoClip
41
+
42
+ device_result = Device.get_device_by_unique_identifier(ws_config, device_uuid)
43
+ if device_result.code != 200 or device_result.device.key <= 0:
44
+ raise RuntimeError('Device identity lookup failed')
45
+
46
+ device_id = device_result.device.key
47
+ result = VideoClip.create_video_clip_list(ws_config, '', clips, device_id=device_id)
48
+ ```
49
+
50
+ The UUID lookup and DeviceID operations require access to the Device. Existing serial-based SDK calls remain supported. Legacy agents can use `Device.resolve_legacy_device_id` to discover and persist an existing Device UUID on their first upgraded startup.
51
+
@@ -0,0 +1,31 @@
1
+ # ActionStreamer
2
+
3
+ A Python library for the ActionStreamer API.
4
+
5
+ ## Version 2 compatibility
6
+
7
+ Version 2 removes the obsolete Stream API, Stream models and Stream result
8
+ types. Source and StreamSession APIs are not replacements for those legacy
9
+ calls. Applications that still require Stream should pin the published
10
+ `actionstreamer==1.4.8` release until migrated.
11
+
12
+ The checked-in version is a development base, not a release. Build local
13
+ development artifacts with `python build_dev.py`; their version includes a
14
+ source fingerprint. Do not publish those artifacts as a release.
15
+
16
+ ## Device identity
17
+
18
+ Resolve an existing Device by its logical UUID once after authentication, then use its DeviceID for operations:
19
+
20
+ ```python
21
+ from actionstreamer.WebService import Device, VideoClip
22
+
23
+ device_result = Device.get_device_by_unique_identifier(ws_config, device_uuid)
24
+ if device_result.code != 200 or device_result.device.key <= 0:
25
+ raise RuntimeError('Device identity lookup failed')
26
+
27
+ device_id = device_result.device.key
28
+ result = VideoClip.create_video_clip_list(ws_config, '', clips, device_id=device_id)
29
+ ```
30
+
31
+ The UUID lookup and DeviceID operations require access to the Device. Existing serial-based SDK calls remain supported. Legacy agents can use `Device.resolve_legacy_device_id` to discover and persist an existing Device UUID on their first upgraded startup.
@@ -3,7 +3,6 @@
3
3
  import json
4
4
  import sys
5
5
  import hashlib
6
- import hmac
7
6
  import uuid
8
7
  import subprocess
9
8
  import time
@@ -23,6 +22,7 @@ from Crypto.Cipher import AES
23
22
  from Crypto.Util.Padding import pad, unpad
24
23
  from actionstreamer.Config import WebServiceConfig
25
24
  from actionstreamer import Result
25
+ from .hmac_signature import dictionary_to_string, get_hmac_signature
26
26
 
27
27
  SwitchValueType = TypeVar("SwitchValueType")
28
28
 
@@ -294,55 +294,6 @@ def send_signed_request_long_poll(ws_config: WebServiceConfig, method: str, url:
294
294
  return result
295
295
 
296
296
 
297
- def get_hmac_signature(secret_key: str, method: str, path: str, headers: Dict[str, str] = {}, parameters: Dict[str, str] = {}, body: str = '')-> tuple[str, str]:
298
-
299
- try:
300
- if 'Content-Type' in headers:
301
- del headers['Content-Type']
302
-
303
- header_string = dictionary_to_string(headers)
304
- parameter_string = dictionary_to_string(parameters)
305
-
306
- # Path should be in the format /v1/event
307
- if not path.startswith('/'):
308
- path = '/' + path
309
-
310
- if path.endswith('/') and len(path) > 1:
311
- path = path[:-1]
312
-
313
- string_to_sign = '\n'.join([method, path, header_string, parameter_string, body if body else ''])
314
-
315
- string_to_sign = string_to_sign.strip()
316
- #log_to_console("stringToSign: " + string_to_sign)
317
-
318
- # Generate the HMAC SHA256 signature
319
- hmac_signature = hmac.new(secret_key.encode('utf-8'), string_to_sign.encode('utf-8'), hashlib.sha256)
320
-
321
- # Convert the HMAC signature to hexadecimal
322
- return hmac_signature.hexdigest(), string_to_sign
323
-
324
- except Exception as ex:
325
- filename, line_number = get_exception_info()
326
- if filename is not None and line_number is not None:
327
- print(f"Exception occurred at line {line_number} in {filename}")
328
- print(ex)
329
-
330
- return 'error', 'error'
331
-
332
-
333
- def dictionary_to_string(dictionary: dict[Any, Any]) -> str:
334
- result = ''
335
-
336
- try:
337
- sorted_keys = sorted(dictionary.keys())
338
- for key in sorted_keys:
339
- result += f"{key}: {dictionary[key]}\n"
340
- except Exception:
341
- pass
342
-
343
- return result
344
-
345
-
346
297
  def _do_upload(file_path: str, signed_url: str, timeout: Optional[int]) -> requests.Response:
347
298
  with open(file_path, 'rb') as file:
348
299
  # Set reasonable connection/read timeouts to avoid hanging forever
@@ -898,6 +849,8 @@ def decrypt_file_gpg_aes256(encrypted_file_path: str, password: str) -> str:
898
849
 
899
850
  def normalize_key_to_32_bytes(key: str) -> bytes:
900
851
  original_key_bytes = key.encode("utf-8")
852
+ if not original_key_bytes:
853
+ raise ValueError("Encryption key must not be empty")
901
854
  normalized_key_bytes = bytearray(32)
902
855
 
903
856
  normalized_key_index = 0
@@ -965,7 +918,7 @@ def unzip_file(zip_file_path: str, output_folder_path: str):
965
918
  zip_ref.extractall(output_folder_path)
966
919
 
967
920
 
968
- def unzip_and_execute(zip_file_path: str, unzip_to_folder_path: str):
921
+ def unzip_and_execute(zip_file_path: str, unzip_to_folder_path: str, *, raise_on_error: bool = False):
969
922
  # This function assumes there is a file called install.json inside the outer zip file, along with a deploy script and the inner zip file.
970
923
  # Outer zip file package_1.2.3.zip:
971
924
  # install.json
@@ -1005,12 +958,16 @@ def unzip_and_execute(zip_file_path: str, unzip_to_folder_path: str):
1005
958
  pass
1006
959
 
1007
960
  except Exception as ex:
961
+ if raise_on_error:
962
+ raise
1008
963
  filename, line_number = get_exception_info()
1009
964
  if filename is not None and line_number is not None:
1010
965
  print(f"Exception occurred at line {line_number} in {filename}")
1011
966
  print(ex)
1012
967
 
1013
968
  except (FileNotFoundError, json.JSONDecodeError) as e:
969
+ if raise_on_error:
970
+ raise
1014
971
  print(f"Error reading JSON file: {e}")
1015
972
  return None, None
1016
973
 
@@ -0,0 +1,44 @@
1
+ import hashlib
2
+ import hmac
3
+ import sys
4
+ from typing import Any
5
+
6
+
7
+ def dictionary_to_string(dictionary: dict[Any, Any]) -> str:
8
+ result = ""
9
+
10
+ try:
11
+ sorted_keys = sorted(dictionary.keys())
12
+ for key in sorted_keys:
13
+ result += f"{key}: {dictionary[key]}\n"
14
+ except Exception:
15
+ pass
16
+
17
+ return result
18
+
19
+
20
+ def get_hmac_signature(secret_key: str, method: str, path: str, headers: dict[str, str] = {}, parameters: dict[str, str] = {}, body: str = "") -> tuple[str, str]:
21
+ try:
22
+ if "Content-Type" in headers:
23
+ del headers["Content-Type"]
24
+
25
+ header_string = dictionary_to_string(headers)
26
+ parameter_string = dictionary_to_string(parameters)
27
+
28
+ if not path.startswith("/"):
29
+ path = "/" + path
30
+
31
+ if path.endswith("/") and len(path) > 1:
32
+ path = path[:-1]
33
+
34
+ string_to_sign = "\n".join([method, path, header_string, parameter_string, body if body else ""])
35
+ string_to_sign = string_to_sign.strip()
36
+ hmac_signature = hmac.new(secret_key.encode("utf-8"), string_to_sign.encode("utf-8"), hashlib.sha256)
37
+ return hmac_signature.hexdigest(), string_to_sign
38
+
39
+ except Exception as exception:
40
+ _, _, exception_traceback = sys.exc_info()
41
+ if exception_traceback is not None:
42
+ print(f"Exception occurred at line {exception_traceback.tb_lineno} in {exception_traceback.tb_frame.f_code.co_filename}")
43
+ print(exception)
44
+ return "error", "error"
@@ -8,6 +8,15 @@ from typing import Any, Dict, Optional, Mapping, cast
8
8
  import requests
9
9
  from actionstreamer import Model
10
10
 
11
+
12
+ def normalize_base_url(base_url: str) -> str:
13
+ """Return an API base URL in the form expected by the web-service wrappers."""
14
+ value = (base_url or '').strip()
15
+ if value and not value.endswith('/'):
16
+ value += '/'
17
+ return value
18
+
19
+
11
20
  class WebServiceConfig:
12
21
 
13
22
  """
@@ -28,7 +37,7 @@ class WebServiceConfig:
28
37
  self.access_key = access_key
29
38
  self.secret_key = secret_key
30
39
  self.session_token = session_token
31
- self.base_url = base_url
40
+ self.base_url = normalize_base_url(base_url)
32
41
  self.timeout = timeout
33
42
  self.ignore_ssl = ignore_ssl
34
43
 
@@ -69,7 +78,7 @@ class WebServiceConfig:
69
78
 
70
79
  class LogConfig:
71
80
 
72
- def __init__(self, ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int, device_name: str = ''):
81
+ def __init__(self, ws_config: WebServiceConfig, device_serial: str, agent_type: str, agent_version: str, agent_index: int, process_id: int, device_name: str = '', device_id: int | None = None):
73
82
  self.ws_config = ws_config
74
83
  self.device_name = device_name
75
84
  self.device_serial = device_serial
@@ -77,6 +86,7 @@ class LogConfig:
77
86
  self.agent_version = agent_version
78
87
  self.agent_index = agent_index
79
88
  self.process_id = process_id
89
+ self.device_id = device_id
80
90
 
81
91
 
82
92
  class AppConfig: