soco-cli 0.4.78__tar.gz → 0.4.80__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 (39) hide show
  1. {soco_cli-0.4.78/soco_cli.egg-info → soco_cli-0.4.80}/PKG-INFO +3 -3
  2. {soco_cli-0.4.78 → soco_cli-0.4.80}/README.md +2 -2
  3. {soco_cli-0.4.78 → soco_cli-0.4.80}/requirements.txt +1 -1
  4. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/__init__.py +1 -1
  5. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/http_api.py +19 -4
  6. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/speaker_info.py +3 -1
  7. {soco_cli-0.4.78 → soco_cli-0.4.80/soco_cli.egg-info}/PKG-INFO +3 -3
  8. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli.egg-info/requires.txt +1 -1
  9. {soco_cli-0.4.78 → soco_cli-0.4.80}/LICENSE +0 -0
  10. {soco_cli-0.4.78 → soco_cli-0.4.80}/MANIFEST.in +0 -0
  11. {soco_cli-0.4.78 → soco_cli-0.4.80}/PYPI_README.md +0 -0
  12. {soco_cli-0.4.78 → soco_cli-0.4.80}/pyproject.toml +0 -0
  13. {soco_cli-0.4.78 → soco_cli-0.4.80}/setup.cfg +0 -0
  14. {soco_cli-0.4.78 → soco_cli-0.4.80}/setup.py +0 -0
  15. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/__main__.py +0 -0
  16. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/action_processor.py +0 -0
  17. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/alarms.py +0 -0
  18. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/aliases.py +0 -0
  19. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/api.py +0 -0
  20. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/check_for_update.py +0 -0
  21. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/cmd_parser.py +0 -0
  22. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/interactive.py +0 -0
  23. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/keystroke_capture.py +0 -0
  24. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/m3u_parser.py +0 -0
  25. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/match_speaker_names.py +0 -0
  26. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/play_local_file.py +0 -0
  27. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/play_local_file_lists.py +0 -0
  28. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/sonos.py +0 -0
  29. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/sonos_discover.py +0 -0
  30. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/speakers.py +0 -0
  31. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/track_follow.py +0 -0
  32. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/utils.py +0 -0
  33. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli/wait_actions.py +0 -0
  34. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli.egg-info/SOURCES.txt +0 -0
  35. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli.egg-info/dependency_links.txt +0 -0
  36. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli.egg-info/entry_points.txt +0 -0
  37. {soco_cli-0.4.78 → soco_cli-0.4.80}/soco_cli.egg-info/top_level.txt +0 -0
  38. {soco_cli-0.4.78 → soco_cli-0.4.80}/tests/test_cli.py +0 -0
  39. {soco_cli-0.4.78 → soco_cli-0.4.80}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: soco-cli
3
- Version: 0.4.78
3
+ Version: 0.4.80
4
4
  Summary: Sonos command line control utility, based on SoCo
5
5
  Author-email: Avantrec Ltd <soco_cli@avantrec.com>
6
6
  Project-URL: Homepage, https://github.com/avantrec/soco-cli
@@ -12,7 +12,7 @@ Requires-Python: >=3.5
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: soco==0.27.1; python_version < "3.6"
15
- Requires-Dist: soco>=0.30.2; python_version >= "3.6"
15
+ Requires-Dist: soco>=0.30.9; python_version >= "3.6"
16
16
  Requires-Dist: ifaddr==0.1.7; python_version < "3.7"
17
17
  Requires-Dist: ifaddr>=0.2.0; python_version >= "3.7"
18
18
  Requires-Dist: tabulate
@@ -62,7 +62,7 @@
62
62
  * [Using the Local Speaker Cache](#using-the-local-speaker-cache)
63
63
  * [HTTP Request Structure](#http-request-structure)
64
64
  * [Return Values](#return-values)
65
- * [Asynchronous Actions](#asynchronous-actions)
65
+ * [Asynchronous Actions (Experimental)](#asynchronous-actions-experimental)
66
66
  * [Macros: Defining Custom HTTP API Server Actions](#macros-defining-custom-http-api-server-actions)
67
67
  * [Macro Definition and Usage](#macro-definition-and-usage)
68
68
  * [Macro Arguments](#macro-arguments)
@@ -85,7 +85,7 @@
85
85
  * [Resources](#resources)
86
86
 
87
87
  <!-- Created by https://github.com/ekalinin/github-markdown-toc -->
88
- <!-- Added by: pwt, at: Mon May 13 16:02:37 BST 2024 -->
88
+ <!-- Added by: pwt, at: Sun May 19 15:54:07 BST 2024 -->
89
89
 
90
90
  <!--te-->
91
91
 
@@ -1,5 +1,5 @@
1
1
  soco == 0.27.1; python_version < "3.6"
2
- soco >= 0.30.2; python_version >= "3.6"
2
+ soco >= 0.30.9; python_version >= "3.6"
3
3
  ifaddr == 0.1.7; python_version < "3.7"
4
4
  ifaddr >= 0.2.0; python_version >= "3.7"
5
5
  tabulate
@@ -10,4 +10,4 @@ server, to control Sonos via HTTP requests.
10
10
  For more information, please see: https://github.com/avantrec/soco-cli
11
11
  """
12
12
 
13
- __version__ = "0.4.78"
13
+ __version__ = "0.4.80"
@@ -9,12 +9,12 @@ if version_info.major == 3 and version_info.minor < 7:
9
9
  import argparse
10
10
  import pprint
11
11
  import shlex
12
- from os import kill
12
+ from os import kill, scandir
13
13
  from os.path import abspath
14
14
  from signal import SIGINT
15
15
  from subprocess import STDOUT, CalledProcessError, Popen, check_output
16
16
  from sys import exit
17
- from typing import Dict, Optional, Tuple
17
+ from typing import Dict, List, Optional, Tuple
18
18
 
19
19
  import uvicorn # type: ignore
20
20
  from fastapi import FastAPI
@@ -24,6 +24,7 @@ from soco_cli.api import get_all_speaker_names
24
24
  from soco_cli.api import get_soco_object as get_speaker
25
25
  from soco_cli.api import rescan_speakers
26
26
  from soco_cli.api import run_command as sc_run
27
+ from soco_cli.play_local_file import is_supported_type
27
28
  from soco_cli.speakers import Speakers
28
29
  from soco_cli.utils import version as print_version
29
30
 
@@ -63,15 +64,16 @@ class ActiveAsyncOps:
63
64
  self.active_async_ops.pop(speaker_ip)
64
65
  return pid
65
66
 
66
- def stop_async_process(self, speaker_ip: str):
67
+ def stop_async_process(self, speaker_ip: str) -> Optional[int]:
67
68
  pid = self.get_async_pid(speaker_ip)
68
69
  if pid is None:
69
- return
70
+ return None
70
71
  try:
71
72
  kill(pid, SIGINT)
72
73
  except:
73
74
  pass
74
75
  self.remove_async_pid(speaker_ip)
76
+ return pid
75
77
 
76
78
 
77
79
  ASYNC_OPS = ActiveAsyncOps()
@@ -184,6 +186,19 @@ def rediscover() -> Dict:
184
186
  return {"speakers_discovered": speakers}
185
187
 
186
188
 
189
+ @sc_app.get("/list_audio_files/{directory:path}")
190
+ def list_audio_files(directory: str) -> List[str]:
191
+ tracks = []
192
+ try:
193
+ with scandir(directory) as files:
194
+ for file in files:
195
+ if is_supported_type(file.name):
196
+ tracks.append(file.name)
197
+ except FileNotFoundError:
198
+ pass
199
+ return tracks
200
+
201
+
187
202
  # Deprecated
188
203
  @sc_app.get("/macros", include_in_schema=False)
189
204
  def macros() -> Dict:
@@ -98,7 +98,9 @@ def print_speaker_table(device):
98
98
  print()
99
99
  print(
100
100
  "Report generated on:",
101
- datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M UTC%z (%A)"),
101
+ datetime.datetime.now(datetime.timezone.utc).strftime(
102
+ "%Y-%m-%d %H:%M UTC (%A)"
103
+ ),
102
104
  )
103
105
 
104
106
  # Print the speaker information table in a nice format
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: soco-cli
3
- Version: 0.4.78
3
+ Version: 0.4.80
4
4
  Summary: Sonos command line control utility, based on SoCo
5
5
  Author-email: Avantrec Ltd <soco_cli@avantrec.com>
6
6
  Project-URL: Homepage, https://github.com/avantrec/soco-cli
@@ -12,7 +12,7 @@ Requires-Python: >=3.5
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: soco==0.27.1; python_version < "3.6"
15
- Requires-Dist: soco>=0.30.2; python_version >= "3.6"
15
+ Requires-Dist: soco>=0.30.9; python_version >= "3.6"
16
16
  Requires-Dist: ifaddr==0.1.7; python_version < "3.7"
17
17
  Requires-Dist: ifaddr>=0.2.0; python_version >= "3.7"
18
18
  Requires-Dist: tabulate
@@ -9,7 +9,7 @@ soco==0.27.1
9
9
  ifaddr==0.1.7
10
10
 
11
11
  [:python_version >= "3.6"]
12
- soco>=0.30.2
12
+ soco>=0.30.9
13
13
 
14
14
  [:python_version >= "3.7"]
15
15
  ifaddr>=0.2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes