ActionStreamer 1.2.28__tar.gz → 1.2.30__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 (37) hide show
  1. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/PKG-INFO +1 -1
  2. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/CommonFunctions/Wifi/Wifi.py +23 -1
  3. actionstreamer-1.2.30/actionstreamer/CommonFunctions/Wifi/__init__.py +4 -0
  4. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Model/Model.py +25 -7
  5. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/API/API.py +31 -0
  6. actionstreamer-1.2.30/actionstreamer/WebService/API/__init__.py +4 -0
  7. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/pyproject.toml +1 -1
  8. actionstreamer-1.2.28/actionstreamer/CommonFunctions/Wifi/__init__.py +0 -4
  9. actionstreamer-1.2.28/actionstreamer/WebService/API/__init__.py +0 -4
  10. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/README.md +0 -0
  11. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/CommonFunctions/CommonFunctions.py +0 -0
  12. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/CommonFunctions/__init__.py +0 -0
  13. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Config/Config.py +0 -0
  14. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Config/__init__.py +0 -0
  15. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Device/Device.py +0 -0
  16. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Device/__init__.py +0 -0
  17. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/Model/__init__.py +0 -0
  18. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Event/Event.py +0 -0
  19. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Event/__init__.py +0 -0
  20. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/EventPreset/EventPreset.py +0 -0
  21. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/EventPreset/__init__.py +0 -0
  22. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/File/File.py +0 -0
  23. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/File/__init__.py +0 -0
  24. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Health/Health.py +0 -0
  25. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Health/__init__.py +0 -0
  26. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/LogMessage/LogMessage.py +0 -0
  27. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/LogMessage/__init__.py +0 -0
  28. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Package/Package.py +0 -0
  29. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Package/__init__.py +0 -0
  30. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Patch/Patch.py +0 -0
  31. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Patch/__init__.py +0 -0
  32. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Tag/Tag.py +0 -0
  33. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/Tag/__init__.py +0 -0
  34. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/VideoClip/VideoClip.py +0 -0
  35. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/VideoClip/__init__.py +0 -0
  36. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/WebService/__init__.py +0 -0
  37. {actionstreamer-1.2.28 → actionstreamer-1.2.30}/actionstreamer/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: actionstreamer
3
- Version: 1.2.28
3
+ Version: 1.2.30
4
4
  Summary: A library for the ActionStreamer API.
5
5
  Author: ActionStreamer
6
6
  Author-email: joe@actionstreamer.com
@@ -1,4 +1,5 @@
1
1
  import json
2
+ import re
2
3
  import subprocess
3
4
 
4
5
 
@@ -93,4 +94,25 @@ def restore_connections(backup_file_path: str) -> None:
93
94
 
94
95
  except (subprocess.CalledProcessError, json.JSONDecodeError) as ex:
95
96
  print(f"Failed to restore connections. Error: {ex}")
96
-
97
+
98
+
99
+ def get_saved_wifi_networks():
100
+ try:
101
+ result = subprocess.run(
102
+ ["nmcli", "-t", "-f", "SSID", "connection", "show"],
103
+ capture_output=True, text=True, check=True
104
+ )
105
+ ssids = [ssid for ssid in result.stdout.splitlines() if ssid]
106
+
107
+ network_info = {
108
+ 'saved_networks': ssids,
109
+ 'network_count': len(ssids)
110
+ }
111
+
112
+ return json.dumps(network_info)
113
+ except subprocess.CalledProcessError as e:
114
+ return json.dumps({
115
+ 'error': f"Error getting wireless network list: {e}",
116
+ 'saved_networks': [],
117
+ 'network_count': 0
118
+ })
@@ -0,0 +1,4 @@
1
+ from .Wifi import add_wifi_connection, remove_wifi_connection, set_wifi_priority, back_up_connections, restore_connections, get_saved_wifi_networks
2
+
3
+
4
+ __all__ = ['add_wifi_connection', 'remove_wifi_connection', 'set_wifi_priority', 'back_up_connections', 'restore_connections', 'get_saved_wifi_networks']
@@ -64,6 +64,11 @@ class EventType:
64
64
  Stop_RTMP = 15
65
65
  Join_conference = 24
66
66
  Leave_conference = 25
67
+ Start_video_split = 28
68
+ Split_start_recording = 29
69
+ Split_start_stream = 30
70
+ Split_join_conference = 31
71
+ Split_start_RTMP = 32
67
72
 
68
73
  class Transcoding(Enum):
69
74
  Transcode_file = 12
@@ -83,6 +88,9 @@ class EventType:
83
88
  Update_setting = 22
84
89
  Clear_flag_queue = 27
85
90
 
91
+ class Workflow:
92
+ Event_preset_workflow = 33
93
+
86
94
 
87
95
  class Event:
88
96
 
@@ -155,7 +163,7 @@ class RecordingParameters:
155
163
 
156
164
  class RecordingArgs:
157
165
 
158
- def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, vflip: int = 0, hflip: int = 0, encoding: str = '', segmentLengthSeconds: float = 0, audio: int = 0, rotationDegrees: int = 0, **kwargs):
166
+ def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, vflip: int = 0, hflip: int = 0, encoding: str = '', segmentLengthSeconds: float = 0, audio: int = 0, rotationDegrees: int = 0, h264_i_qp: int = 20, h264_p_qp: int = 23, h264_b_qp: int = 25, **kwargs):
159
167
  self.height = height
160
168
  self.width = width
161
169
  self.fps = fps
@@ -166,6 +174,10 @@ class RecordingArgs:
166
174
  self.segmentLengthSeconds = segmentLengthSeconds
167
175
  self.audio = audio
168
176
  self.rotationDegrees = rotationDegrees
177
+ self.h264_i_qp = h264_i_qp
178
+ self.h264_p_qp = h264_p_qp
179
+ self.h264_b_qp = h264_b_qp
180
+
169
181
  # Store or ignore unknown fields
170
182
  self.extra_fields = kwargs # Optionally, store unknown fields for debugging or logging
171
183
 
@@ -191,7 +203,7 @@ class RecordingArgs:
191
203
  # Deprecated
192
204
  class RTMPParameters:
193
205
 
194
- def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, server: str = '', port: int = 0, streamName: str = '', streamKey: str = '', hflip: int = 0, vflip: int = 0, **kwargs):
206
+ def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, server: str = '', port: int = 0, streamName: str = '', streamKey: str = '', hflip: int = 0, vflip: int = 0, splitVideoSource: str = '', **kwargs):
195
207
  self.height = height
196
208
  self.width = width
197
209
  self.fps = fps
@@ -202,6 +214,7 @@ class RTMPParameters:
202
214
  self.stream_key = streamKey
203
215
  self.hflip = hflip
204
216
  self.vflip = vflip
217
+ self.split_video_source = splitVideoSource
205
218
  # Optionally store any extra fields
206
219
  self.extra_fields = kwargs
207
220
 
@@ -212,7 +225,7 @@ class RTMPParameters:
212
225
 
213
226
  class RTMPArgs:
214
227
 
215
- def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, server: str = '', port: int = 0, streamName: str = '', streamKey: str = '', hflip: int = 0, vflip: int = 0, rotationDegrees: int = 0, **kwargs):
228
+ def __init__(self, height: int = 1920, width: int = 1080, fps: float = 30, bitrate: int = 5000000, server: str = '', port: int = 0, streamName: str = '', streamKey: str = '', hflip: int = 0, vflip: int = 0, rotationDegrees: int = 0, splitVideoSource: str = '', **kwargs):
216
229
  self.height = height
217
230
  self.width = width
218
231
  self.fps = fps
@@ -224,6 +237,7 @@ class RTMPArgs:
224
237
  self.hflip = hflip
225
238
  self.vflip = vflip
226
239
  self.rotationDegrees = rotationDegrees
240
+ self.split_video_source = splitVideoSource
227
241
  # Optionally store any extra fields
228
242
  self.extra_fields = kwargs
229
243
 
@@ -296,13 +310,14 @@ class VideoClip:
296
310
  # Deprecated
297
311
  class TranscodingParameters:
298
312
 
299
- def __init__(self, fileID: int, source: str, sourceFile: str, targetFile: str, fps: float, codec: str, **kwargs):
313
+ def __init__(self, fileID: int, source: str, sourceFile: str, targetFile: str, fps: float, codec: str, splitVideoSource: str = '', **kwargs):
300
314
  self.fileID = fileID
301
315
  self.source = source
302
316
  self.sourceFile = sourceFile
303
317
  self.targetFile = targetFile
304
318
  self.fps = fps
305
319
  self.codec = codec
320
+ self.split_video_source = splitVideoSource
306
321
  # Optionally store any extra fields
307
322
  self.extra_fields = kwargs
308
323
 
@@ -313,13 +328,14 @@ class TranscodingParameters:
313
328
 
314
329
  class TranscodingArgs:
315
330
 
316
- def __init__(self, fileID: int, source: str, sourceFile: str, targetFile: str, fps: float, codec: str, **kwargs):
331
+ def __init__(self, fileID: int, source: str, sourceFile: str, targetFile: str, fps: float, codec: str, splitVideoSource: str = '', **kwargs):
317
332
  self.fileID = fileID
318
333
  self.source = source
319
334
  self.sourceFile = sourceFile
320
335
  self.targetFile = targetFile
321
336
  self.fps = fps
322
337
  self.codec = codec
338
+ self.split_video_source = splitVideoSource
323
339
  # Optionally store any extra fields
324
340
  self.extra_fields = kwargs
325
341
 
@@ -370,7 +386,7 @@ class ConcatenateClipsArgs:
370
386
 
371
387
  class ConferenceArgs:
372
388
 
373
- def __init__(self, url: str, roomName: str, displayName: str, videoWidth: int = 1280, videoHeight: int = 720, framerate: float = 30, videoBitrate: int = 1000000, sendVideo: bool = True, sendAudio: bool = True, receiveVideo: bool = True, receiveAudio: bool = True, rotationDegrees: int = 0, **kwargs):
389
+ def __init__(self, url: str, roomName: str, displayName: str, videoWidth: int = 1280, videoHeight: int = 720, framerate: float = 30, videoBitrate: int = 1000000, sendVideo: bool = True, sendAudio: bool = True, receiveVideo: bool = True, receiveAudio: bool = True, rotationDegrees: int = 0, splitVideoSource: str = '', **kwargs):
374
390
  self.url = url
375
391
  self.roomName = roomName
376
392
  self.displayName = displayName
@@ -383,6 +399,7 @@ class ConferenceArgs:
383
399
  self.receiveVideo = receiveVideo
384
400
  self.receiveAudio = receiveAudio
385
401
  self.rotationDegrees = rotationDegrees
402
+ self.split_video_source = splitVideoSource
386
403
  # Store or ignore unknown fields
387
404
  self.extra_fields = kwargs # Optionally, store unknown fields for debugging or logging
388
405
 
@@ -584,7 +601,7 @@ class EventPreset:
584
601
  # Deprecated
585
602
  class StartRecordingParameters:
586
603
  # Note 2024-02-14: This is just a duplicate of the above RecordingArgs class
587
- def __init__(self, width: int = 0, height: int = 0, fps: int = 0, bitrate: int = 0, segmentLengthSeconds: int = 0, hflip: int = 0, vflip: int = 0, rotationDegrees: int = 0, audio: int = 0, **kwargs):
604
+ def __init__(self, width: int = 0, height: int = 0, fps: int = 0, bitrate: int = 0, segmentLengthSeconds: int = 0, hflip: int = 0, vflip: int = 0, rotationDegrees: int = 0, audio: int = 0, splitVideoSource: str = '', **kwargs):
588
605
  self.width = width
589
606
  self.height = height
590
607
  self.fps = fps
@@ -594,6 +611,7 @@ class StartRecordingParameters:
594
611
  self.vflip = vflip
595
612
  self.rotationDegrees = rotationDegrees
596
613
  self.audio = audio
614
+ self.split_video_source = splitVideoSource
597
615
 
598
616
  # Warn or log if there are unexpected keyword arguments
599
617
  if kwargs:
@@ -116,4 +116,35 @@ def get_device(ws_config: actionstreamer.Config.WebServiceConfig, device_name: s
116
116
  print(ex)
117
117
  ws_result.description = str(ex)
118
118
 
119
+ return ws_result
120
+
121
+
122
+ def get_device_by_id(ws_config: actionstreamer.Config.WebServiceConfig, device_id: int) -> WebServiceResult:
123
+
124
+ ws_result = WebServiceResult(0, '', '', '', None)
125
+
126
+ try:
127
+ json_post_data = {}
128
+
129
+ method = "GET"
130
+ path = 'v1/device/' + str(device_id)
131
+ url = ws_config.base_url + path
132
+ headers = {"Content-Type": "application/json"}
133
+ parameters = ''
134
+
135
+ response_code, response_string = actionstreamer.CommonFunctions.send_signed_request(ws_config, method, url, path, headers, parameters, '')
136
+
137
+ ws_result.http_response_code = response_code
138
+ ws_result.http_response_string = response_string
139
+ ws_result.json_data = json.loads(response_string)
140
+
141
+ except Exception as ex:
142
+
143
+ ws_result.code = -1
144
+ filename, line_number = actionstreamer.CommonFunctions.get_exception_info()
145
+ if filename is not None and line_number is not None:
146
+ print(f"Exception occurred in get_device at line {line_number} in {filename}")
147
+ print(ex)
148
+ ws_result.description = str(ex)
149
+
119
150
  return ws_result
@@ -0,0 +1,4 @@
1
+ from .API import PatchOperation, WebServiceResult, DateTimeEncoder, register_agent, device_ready, get_device, get_device_by_id
2
+
3
+
4
+ __all__ = ['PatchOperation', 'WebServiceResult', 'DateTimeEncoder', 'register_agent', 'device_ready', 'get_device', 'get_device_by_id']
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "actionstreamer"
3
- version = "1.2.28"
3
+ version = "1.2.30"
4
4
  description = "A library for the ActionStreamer API."
5
5
  authors = ["ActionStreamer <joe@actionstreamer.com>"]
6
6
  readme = "README.md"
@@ -1,4 +0,0 @@
1
- from .Wifi import add_wifi_connection, remove_wifi_connection, set_wifi_priority, back_up_connections, restore_connections
2
-
3
-
4
- __all__ = ['add_wifi_connection', 'remove_wifi_connection', 'set_wifi_priority', 'back_up_connections', 'restore_connections']
@@ -1,4 +0,0 @@
1
- from .API import PatchOperation, WebServiceResult, DateTimeEncoder, register_agent, device_ready, get_device
2
-
3
-
4
- __all__ = ['PatchOperation', 'WebServiceResult', 'DateTimeEncoder', 'register_agent', 'device_ready', 'get_device']