aiostreamsdk 0.1.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.
@@ -0,0 +1,40 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ lint:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ with:
17
+ fetch-depth: 0
18
+ - uses: astral-sh/setup-uv@v10.4.1
19
+ - run: uv sync --locked
20
+ - run: uv run ruff format --check .
21
+ - run: uv run ruff check .
22
+ - run: uv run mypy
23
+ - run: uv run bandit -c pyproject.toml -r src
24
+ - run: uv run pip-audit
25
+
26
+ test:
27
+ runs-on: ubuntu-latest
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ python: ["3.12", "3.13", "3.14"]
32
+ steps:
33
+ - uses: actions/checkout@v7
34
+ with:
35
+ fetch-depth: 0
36
+ - uses: astral-sh/setup-uv@v10.4.1
37
+ with:
38
+ python-version: ${{ matrix.python }}
39
+ - run: uv sync --locked
40
+ - run: uv run pytest
@@ -0,0 +1,39 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v7
15
+ with:
16
+ fetch-depth: 0
17
+ - uses: astral-sh/setup-uv@v10.4.1
18
+ - run: uv sync --locked
19
+ - run: uv run pytest
20
+ - run: uv build
21
+ - uses: actions/upload-artifact@v7
22
+ with:
23
+ name: dist
24
+ path: dist/
25
+
26
+ publish:
27
+ needs: build
28
+ runs-on: ubuntu-latest
29
+ environment:
30
+ name: pypi
31
+ url: https://pypi.org/p/aiostreamsdk
32
+ permissions:
33
+ id-token: write
34
+ steps:
35
+ - uses: actions/download-artifact@v8
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - uses: pypa/gh-action-pypi-publish@v1.14.3
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ htmlcov/
9
+ dist/
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nyxdis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.5
2
+ Name: aiostreamsdk
3
+ Version: 0.1.0
4
+ Summary: Async client for the local HTTP API of StreamUnlimited StreamSDK audio devices (Teufel, Fosi, VSSL, Arcam, ...)
5
+ Project-URL: Homepage, https://github.com/nyxdis/aiostreamsdk
6
+ Project-URL: Issues, https://github.com/nyxdis/aiostreamsdk/issues
7
+ Author: nyxdis
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: asyncio,audio,nsdk,streamsdk,streamunlimited,teufel
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Home Automation
20
+ Classifier: Topic :: Multimedia :: Sound/Audio
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.12
23
+ Requires-Dist: aiohttp>=3.9
24
+ Description-Content-Type: text/markdown
25
+
26
+ # aiostreamsdk
27
+
28
+ Async Python client for the local HTTP API of audio devices built on
29
+ [StreamUnlimited](https://www.streamunlimited.com/) **StreamSDK** (also called NSDK):
30
+ Teufel Cinebar Pro 2 and Motiv Home, and probably Fosi Audio S3, VSSL MX, Arcam,
31
+ JBL and other streamers with a StreamUnlimited module.
32
+
33
+ The API is undocumented. This library was written against a Teufel Cinebar Pro 2
34
+ (firmware 1.0.201) and a Teufel Motiv Home (firmware 1.0.36). It needs no login:
35
+ anyone on the local network can talk to these devices.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install aiostreamsdk
41
+ ```
42
+
43
+ Requires Python 3.12+ and aiohttp.
44
+
45
+ ## Usage
46
+
47
+ ```python
48
+ import asyncio
49
+
50
+ from aiostreamsdk import EventListener, StreamSDKClient, wrap
51
+
52
+
53
+ async def main() -> None:
54
+ async with StreamSDKClient("192.168.1.50") as sdk:
55
+ # Read a node with its metadata
56
+ volume = await sdk.get_node("player:volume")
57
+ print(volume.native, volume.edit) # 26 {'type': 'slider', 'min': '0', ...}
58
+
59
+ # Power
60
+ power = await sdk.get_node("powermanager:target")
61
+ print(power.native["target"]) # "online" or "networkStandby"
62
+ await sdk.wake()
63
+
64
+ # Write a typed value (writes wake the device)
65
+ await sdk.set_value("player:volume", wrap("i32_", 30))
66
+
67
+ # List inputs and play one
68
+ inputs = [r for r in await sdk.get_rows("ui:") if r.get("type") == "audio"]
69
+ await sdk.play_item(inputs[0])
70
+
71
+ # Follow changes
72
+ listener = EventListener(
73
+ sdk,
74
+ ["player:volume", "powermanager:target"],
75
+ lambda events: print([(e.path, e.native) for e in events]),
76
+ )
77
+ await listener.run() # until cancelled
78
+
79
+
80
+ asyncio.run(main())
81
+ ```
82
+
83
+ ## The API in short
84
+
85
+ | Request | Purpose |
86
+ |---|---|
87
+ | `GET /api/getData?path=<p>&roles=@all` | Read a node (value, title, `modifiable`, `edit` limits or `enumPath`) |
88
+ | `GET /api/getRows?path=<p>&roles=@all&from=0&to=100` | List a container (inputs at `ui:`, settings at `settings:/`) |
89
+ | `POST /api/setData` `{"path", "role": "value", "value"}` | Write a typed value such as `{"type": "i32_", "i32_": 30}` |
90
+ | `POST /api/setData` `{"path", "role": "activate", "value"}` | Trigger an action, e.g. `powermanager:goOnline` |
91
+ | `POST /api/event/modifyQueue` / `GET /api/event/pollQueue` | Subscribe to and long-poll value changes |
92
+
93
+ Useful paths: `powermanager:target` (power state), `powermanager:goOnline` /
94
+ `goNetworkStandby` / `goReboot`, `player:volume`, `settings:/mediaPlayer/mute`,
95
+ `player:player/data` (player state and current item), `player:player/control`
96
+ (play, pause, stop, next, previous). Which other nodes exist depends on the model;
97
+ `get_nodes()` skips the ones a device does not have.
98
+
99
+ ## Development
100
+
101
+ ```bash
102
+ uv sync
103
+ uv run ruff format . && uv run ruff check . && uv run mypy && uv run pytest
104
+ ```
105
+
106
+ Releases are published to PyPI from GitHub releases via Trusted Publishing.
107
+
108
+ ## License
109
+
110
+ MIT
@@ -0,0 +1,85 @@
1
+ # aiostreamsdk
2
+
3
+ Async Python client for the local HTTP API of audio devices built on
4
+ [StreamUnlimited](https://www.streamunlimited.com/) **StreamSDK** (also called NSDK):
5
+ Teufel Cinebar Pro 2 and Motiv Home, and probably Fosi Audio S3, VSSL MX, Arcam,
6
+ JBL and other streamers with a StreamUnlimited module.
7
+
8
+ The API is undocumented. This library was written against a Teufel Cinebar Pro 2
9
+ (firmware 1.0.201) and a Teufel Motiv Home (firmware 1.0.36). It needs no login:
10
+ anyone on the local network can talk to these devices.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install aiostreamsdk
16
+ ```
17
+
18
+ Requires Python 3.12+ and aiohttp.
19
+
20
+ ## Usage
21
+
22
+ ```python
23
+ import asyncio
24
+
25
+ from aiostreamsdk import EventListener, StreamSDKClient, wrap
26
+
27
+
28
+ async def main() -> None:
29
+ async with StreamSDKClient("192.168.1.50") as sdk:
30
+ # Read a node with its metadata
31
+ volume = await sdk.get_node("player:volume")
32
+ print(volume.native, volume.edit) # 26 {'type': 'slider', 'min': '0', ...}
33
+
34
+ # Power
35
+ power = await sdk.get_node("powermanager:target")
36
+ print(power.native["target"]) # "online" or "networkStandby"
37
+ await sdk.wake()
38
+
39
+ # Write a typed value (writes wake the device)
40
+ await sdk.set_value("player:volume", wrap("i32_", 30))
41
+
42
+ # List inputs and play one
43
+ inputs = [r for r in await sdk.get_rows("ui:") if r.get("type") == "audio"]
44
+ await sdk.play_item(inputs[0])
45
+
46
+ # Follow changes
47
+ listener = EventListener(
48
+ sdk,
49
+ ["player:volume", "powermanager:target"],
50
+ lambda events: print([(e.path, e.native) for e in events]),
51
+ )
52
+ await listener.run() # until cancelled
53
+
54
+
55
+ asyncio.run(main())
56
+ ```
57
+
58
+ ## The API in short
59
+
60
+ | Request | Purpose |
61
+ |---|---|
62
+ | `GET /api/getData?path=<p>&roles=@all` | Read a node (value, title, `modifiable`, `edit` limits or `enumPath`) |
63
+ | `GET /api/getRows?path=<p>&roles=@all&from=0&to=100` | List a container (inputs at `ui:`, settings at `settings:/`) |
64
+ | `POST /api/setData` `{"path", "role": "value", "value"}` | Write a typed value such as `{"type": "i32_", "i32_": 30}` |
65
+ | `POST /api/setData` `{"path", "role": "activate", "value"}` | Trigger an action, e.g. `powermanager:goOnline` |
66
+ | `POST /api/event/modifyQueue` / `GET /api/event/pollQueue` | Subscribe to and long-poll value changes |
67
+
68
+ Useful paths: `powermanager:target` (power state), `powermanager:goOnline` /
69
+ `goNetworkStandby` / `goReboot`, `player:volume`, `settings:/mediaPlayer/mute`,
70
+ `player:player/data` (player state and current item), `player:player/control`
71
+ (play, pause, stop, next, previous). Which other nodes exist depends on the model;
72
+ `get_nodes()` skips the ones a device does not have.
73
+
74
+ ## Development
75
+
76
+ ```bash
77
+ uv sync
78
+ uv run ruff format . && uv run ruff check . && uv run mypy && uv run pytest
79
+ ```
80
+
81
+ Releases are published to PyPI from GitHub releases via Trusted Publishing.
82
+
83
+ ## License
84
+
85
+ MIT
@@ -0,0 +1,85 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27", "hatch-vcs>=0.5"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "aiostreamsdk"
7
+ dynamic = ["version"]
8
+ description = "Async client for the local HTTP API of StreamUnlimited StreamSDK audio devices (Teufel, Fosi, VSSL, Arcam, ...)"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "nyxdis" }]
13
+ requires-python = ">=3.12"
14
+ dependencies = ["aiohttp>=3.9"]
15
+ keywords = ["streamsdk", "streamunlimited", "nsdk", "teufel", "audio", "asyncio"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Framework :: AsyncIO",
19
+ "Intended Audience :: Developers",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Topic :: Home Automation",
26
+ "Topic :: Multimedia :: Sound/Audio",
27
+ "Typing :: Typed",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/nyxdis/aiostreamsdk"
32
+ Issues = "https://github.com/nyxdis/aiostreamsdk/issues"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=9.0",
37
+ "pytest-aiohttp>=1.1",
38
+ "pytest-asyncio>=1.3",
39
+ "pytest-cov>=7.0",
40
+ "ruff>=0.14",
41
+ "mypy>=1.19",
42
+ "bandit>=1.9",
43
+ "pip-audit>=2.9",
44
+ ]
45
+
46
+ [tool.hatch.version]
47
+ source = "vcs"
48
+ fallback-version = "0.0.0"
49
+
50
+ [tool.hatch.build.targets.wheel]
51
+ packages = ["src/aiostreamsdk"]
52
+
53
+ [tool.ruff]
54
+ target-version = "py312"
55
+ line-length = 88
56
+ src = ["src", "tests"]
57
+
58
+ [tool.ruff.lint]
59
+ select = ["E", "W", "F", "I", "B", "C4", "UP", "ARG", "SIM"]
60
+ ignore = ["E501"]
61
+
62
+ [tool.ruff.lint.isort]
63
+ known-first-party = ["aiostreamsdk"]
64
+ force-sort-within-sections = true
65
+ combine-as-imports = true
66
+
67
+ [tool.mypy]
68
+ python_version = "3.12"
69
+ strict = true
70
+ warn_return_any = true
71
+ warn_unused_ignores = true
72
+ show_error_codes = true
73
+ files = ["src"]
74
+
75
+ [tool.bandit]
76
+ exclude_dirs = ["tests", ".venv"]
77
+
78
+ [tool.pytest.ini_options]
79
+ asyncio_mode = "auto"
80
+ asyncio_default_fixture_loop_scope = "function"
81
+ testpaths = ["tests"]
82
+ addopts = "--cov=aiostreamsdk --cov-report=term-missing --cov-fail-under=90"
83
+
84
+ [tool.coverage.run]
85
+ branch = true
@@ -0,0 +1,48 @@
1
+ """Async client for StreamUnlimited StreamSDK audio devices."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib.metadata import PackageNotFoundError, version
6
+
7
+ from .client import (
8
+ PATH_GO_ONLINE,
9
+ PATH_GO_STANDBY,
10
+ PATH_PLAYER_CONTROL,
11
+ PATH_POWER,
12
+ PATH_REBOOT,
13
+ StreamSDKClient,
14
+ )
15
+ from .events import EventListener
16
+ from .exceptions import (
17
+ StreamSDKApiError,
18
+ StreamSDKConnectionError,
19
+ StreamSDKError,
20
+ StreamSDKNotModifiableError,
21
+ StreamSDKPathNotFoundError,
22
+ )
23
+ from .models import Event, Node, unwrap, wrap
24
+
25
+ try:
26
+ __version__ = version("aiostreamsdk")
27
+ except PackageNotFoundError: # pragma: no cover
28
+ __version__ = "0.0.0"
29
+
30
+ __all__ = [
31
+ "PATH_GO_ONLINE",
32
+ "PATH_GO_STANDBY",
33
+ "PATH_PLAYER_CONTROL",
34
+ "PATH_POWER",
35
+ "PATH_REBOOT",
36
+ "Event",
37
+ "EventListener",
38
+ "Node",
39
+ "StreamSDKApiError",
40
+ "StreamSDKClient",
41
+ "StreamSDKConnectionError",
42
+ "StreamSDKError",
43
+ "StreamSDKNotModifiableError",
44
+ "StreamSDKPathNotFoundError",
45
+ "__version__",
46
+ "unwrap",
47
+ "wrap",
48
+ ]