aiotssdk 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.
- aiotssdk-0.1.0/.github/workflows/ci.yml +40 -0
- aiotssdk-0.1.0/.github/workflows/release.yml +39 -0
- aiotssdk-0.1.0/.github/workflows/scorecard.yml +30 -0
- aiotssdk-0.1.0/.gitignore +9 -0
- aiotssdk-0.1.0/.python-version +1 -0
- aiotssdk-0.1.0/LICENSE +21 -0
- aiotssdk-0.1.0/PKG-INFO +113 -0
- aiotssdk-0.1.0/README.md +88 -0
- aiotssdk-0.1.0/SECURITY.md +11 -0
- aiotssdk-0.1.0/docs/protocol.md +138 -0
- aiotssdk-0.1.0/pyproject.toml +85 -0
- aiotssdk-0.1.0/renovate.json +18 -0
- aiotssdk-0.1.0/src/aiotssdk/__init__.py +40 -0
- aiotssdk-0.1.0/src/aiotssdk/client.py +380 -0
- aiotssdk-0.1.0/src/aiotssdk/discovery.py +78 -0
- aiotssdk-0.1.0/src/aiotssdk/exceptions.py +55 -0
- aiotssdk-0.1.0/src/aiotssdk/models.py +67 -0
- aiotssdk-0.1.0/src/aiotssdk/py.typed +0 -0
- aiotssdk-0.1.0/tests/__init__.py +0 -0
- aiotssdk-0.1.0/tests/conftest.py +144 -0
- aiotssdk-0.1.0/tests/test_client.py +338 -0
- aiotssdk-0.1.0/tests/test_discovery.py +110 -0
- aiotssdk-0.1.0/uv.lock +1775 -0
|
@@ -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/aiotssdk
|
|
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,30 @@
|
|
|
1
|
+
name: Scorecard
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: "23 5 * * 1"
|
|
8
|
+
branch_protection_rule:
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
permissions: read-all
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
analysis:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
security-events: write
|
|
18
|
+
id-token: write
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
- uses: ossf/scorecard-action@v2.6.0
|
|
24
|
+
with:
|
|
25
|
+
results_file: results.sarif
|
|
26
|
+
results_format: sarif
|
|
27
|
+
publish_results: true
|
|
28
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
29
|
+
with:
|
|
30
|
+
sarif_file: results.sarif
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
aiotssdk-0.1.0/LICENSE
ADDED
|
@@ -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.
|
aiotssdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: aiotssdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Async client for the local WAMP API of Teufel TSSDK audio devices (STEREO M 2, ...)
|
|
5
|
+
Project-URL: Homepage, https://github.com/nyxdis/aiotssdk
|
|
6
|
+
Project-URL: Issues, https://github.com/nyxdis/aiotssdk/issues
|
|
7
|
+
Author: nyxdis
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: asyncio,audio,teufel,tssdk,wamp
|
|
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
|
+
# aiotssdk
|
|
27
|
+
|
|
28
|
+
[](https://github.com/nyxdis/aiotssdk/actions/workflows/ci.yml)
|
|
29
|
+
[](https://scorecard.dev/viewer/?uri=github.com/nyxdis/aiotssdk)
|
|
30
|
+
[](https://pypi.org/project/aiotssdk/)
|
|
31
|
+
|
|
32
|
+
Async Python client for the local network API of Teufel audio devices with the
|
|
33
|
+
**TSSDK** firmware, such as the Teufel STEREO M 2.
|
|
34
|
+
|
|
35
|
+
These devices run a [WAMP](https://wamp-proto.org/) router on port 8001
|
|
36
|
+
(WebSocket, JSON, realm `teufel`) that needs no login: anyone on the local network
|
|
37
|
+
can talk to them. Older Teufel streaming devices (Cinebar Pro 2, Motiv Home) use a
|
|
38
|
+
different API; see [aiostreamsdk](https://github.com/nyxdis/aiostreamsdk) for those.
|
|
39
|
+
|
|
40
|
+
This is an unofficial project, not affiliated with or endorsed by Teufel. It was
|
|
41
|
+
tested against a Teufel STEREO M 2 (firmware 1.5.1). Known procedures, value types
|
|
42
|
+
and quirks are collected in [docs/protocol.md](docs/protocol.md).
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install aiotssdk
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Requires Python 3.12+ and aiohttp.
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import asyncio
|
|
56
|
+
|
|
57
|
+
from aiotssdk import TssdkClient, TssdkNotAllowedError, discover
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
async def main() -> None:
|
|
61
|
+
# Find devices on the network (UDP broadcast), or identify one by address
|
|
62
|
+
for device in await discover():
|
|
63
|
+
print(device.host, device.name, device.model_name, device.firmware_version)
|
|
64
|
+
|
|
65
|
+
async with TssdkClient("192.168.1.50") as tssdk:
|
|
66
|
+
# Properties: X.get / X.set / topic X
|
|
67
|
+
print(await tssdk.get("audiocontrol.volume")) # 31
|
|
68
|
+
await tssdk.set("audiocontrol.volume", 35)
|
|
69
|
+
print(await tssdk.get("audiocontrol.eq.graphic.bands"))
|
|
70
|
+
|
|
71
|
+
# Actions are plain calls
|
|
72
|
+
await tssdk.call("power.standby.leave")
|
|
73
|
+
try:
|
|
74
|
+
await tssdk.call("playback.seek", 60)
|
|
75
|
+
except TssdkNotAllowedError:
|
|
76
|
+
print("seeking is not possible for this source")
|
|
77
|
+
|
|
78
|
+
# Follow changes (exact topic names only)
|
|
79
|
+
await tssdk.subscribe(
|
|
80
|
+
"audiocontrol.volume", lambda event: print("volume", event.value)
|
|
81
|
+
)
|
|
82
|
+
tssdk.add_disconnect_callback(lambda err: print("disconnected", err))
|
|
83
|
+
await asyncio.sleep(60)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
asyncio.run(main())
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
After a lost connection, call `connect()` again: subscriptions are renewed
|
|
90
|
+
automatically. The device does not answer WebSocket pings, so the client sends
|
|
91
|
+
none; poll a cheap property now and then if you need to notice a dead connection.
|
|
92
|
+
|
|
93
|
+
## Errors
|
|
94
|
+
|
|
95
|
+
| Exception | When |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `TssdkConnectionError` | cannot connect, connection lost, no answer in time |
|
|
98
|
+
| `TssdkNoSuchProcedureError` | the device does not offer the procedure |
|
|
99
|
+
| `TssdkInvalidArgumentError` | the arguments were rejected |
|
|
100
|
+
| `TssdkNotAllowedError` | not possible in the current state (e.g. seeking AirPlay) |
|
|
101
|
+
| `TssdkApiError` | any other WAMP error; `.error` holds the URI |
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv sync
|
|
107
|
+
uv run pytest
|
|
108
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
aiotssdk-0.1.0/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# aiotssdk
|
|
2
|
+
|
|
3
|
+
[](https://github.com/nyxdis/aiotssdk/actions/workflows/ci.yml)
|
|
4
|
+
[](https://scorecard.dev/viewer/?uri=github.com/nyxdis/aiotssdk)
|
|
5
|
+
[](https://pypi.org/project/aiotssdk/)
|
|
6
|
+
|
|
7
|
+
Async Python client for the local network API of Teufel audio devices with the
|
|
8
|
+
**TSSDK** firmware, such as the Teufel STEREO M 2.
|
|
9
|
+
|
|
10
|
+
These devices run a [WAMP](https://wamp-proto.org/) router on port 8001
|
|
11
|
+
(WebSocket, JSON, realm `teufel`) that needs no login: anyone on the local network
|
|
12
|
+
can talk to them. Older Teufel streaming devices (Cinebar Pro 2, Motiv Home) use a
|
|
13
|
+
different API; see [aiostreamsdk](https://github.com/nyxdis/aiostreamsdk) for those.
|
|
14
|
+
|
|
15
|
+
This is an unofficial project, not affiliated with or endorsed by Teufel. It was
|
|
16
|
+
tested against a Teufel STEREO M 2 (firmware 1.5.1). Known procedures, value types
|
|
17
|
+
and quirks are collected in [docs/protocol.md](docs/protocol.md).
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install aiotssdk
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Requires Python 3.12+ and aiohttp.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import asyncio
|
|
31
|
+
|
|
32
|
+
from aiotssdk import TssdkClient, TssdkNotAllowedError, discover
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
async def main() -> None:
|
|
36
|
+
# Find devices on the network (UDP broadcast), or identify one by address
|
|
37
|
+
for device in await discover():
|
|
38
|
+
print(device.host, device.name, device.model_name, device.firmware_version)
|
|
39
|
+
|
|
40
|
+
async with TssdkClient("192.168.1.50") as tssdk:
|
|
41
|
+
# Properties: X.get / X.set / topic X
|
|
42
|
+
print(await tssdk.get("audiocontrol.volume")) # 31
|
|
43
|
+
await tssdk.set("audiocontrol.volume", 35)
|
|
44
|
+
print(await tssdk.get("audiocontrol.eq.graphic.bands"))
|
|
45
|
+
|
|
46
|
+
# Actions are plain calls
|
|
47
|
+
await tssdk.call("power.standby.leave")
|
|
48
|
+
try:
|
|
49
|
+
await tssdk.call("playback.seek", 60)
|
|
50
|
+
except TssdkNotAllowedError:
|
|
51
|
+
print("seeking is not possible for this source")
|
|
52
|
+
|
|
53
|
+
# Follow changes (exact topic names only)
|
|
54
|
+
await tssdk.subscribe(
|
|
55
|
+
"audiocontrol.volume", lambda event: print("volume", event.value)
|
|
56
|
+
)
|
|
57
|
+
tssdk.add_disconnect_callback(lambda err: print("disconnected", err))
|
|
58
|
+
await asyncio.sleep(60)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
asyncio.run(main())
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
After a lost connection, call `connect()` again: subscriptions are renewed
|
|
65
|
+
automatically. The device does not answer WebSocket pings, so the client sends
|
|
66
|
+
none; poll a cheap property now and then if you need to notice a dead connection.
|
|
67
|
+
|
|
68
|
+
## Errors
|
|
69
|
+
|
|
70
|
+
| Exception | When |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `TssdkConnectionError` | cannot connect, connection lost, no answer in time |
|
|
73
|
+
| `TssdkNoSuchProcedureError` | the device does not offer the procedure |
|
|
74
|
+
| `TssdkInvalidArgumentError` | the arguments were rejected |
|
|
75
|
+
| `TssdkNotAllowedError` | not possible in the current state (e.g. seeking AirPlay) |
|
|
76
|
+
| `TssdkApiError` | any other WAMP error; `.error` holds the URI |
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uv sync
|
|
82
|
+
uv run pytest
|
|
83
|
+
uv run ruff check . && uv run ruff format --check . && uv run mypy
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
Please report security problems privately through
|
|
4
|
+
[GitHub's vulnerability reporting](https://github.com/nyxdis/aiotssdk/security/advisories/new),
|
|
5
|
+
not in a public issue. You will get an answer within a week.
|
|
6
|
+
|
|
7
|
+
Only the latest release is supported with fixes.
|
|
8
|
+
|
|
9
|
+
Note that TSSDK devices expose an unauthenticated WAMP API on the local
|
|
10
|
+
network by design. That is a property of the device firmware, not a
|
|
11
|
+
vulnerability in this project.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Teufel TSSDK local protocol
|
|
2
|
+
|
|
3
|
+
Unofficial notes on the local network API of Teufel devices that use the
|
|
4
|
+
"TSSDK" firmware, written for interoperability and tested against a
|
|
5
|
+
Teufel STEREO M 2 (firmware 1.5.1). Names marked "other models" are not
|
|
6
|
+
registered on the STEREO M 2 and are expected on other devices (e.g. soundbars
|
|
7
|
+
with distance/level calibration).
|
|
8
|
+
|
|
9
|
+
## Discovery
|
|
10
|
+
|
|
11
|
+
- mDNS: `_teufelstreaming._tcp`, port = WAMP port. TXT: `deviceId`, `modelName`,
|
|
12
|
+
`firmwareVersion`, `macAddress`.
|
|
13
|
+
- UDP: send `{"discoveryType": "device", "discoveryVersion": 1}` to port 8000
|
|
14
|
+
(broadcast or unicast). Reply:
|
|
15
|
+
`{colorId, colorName, deviceId, deviceName, discoveryType, discoveryVersion,
|
|
16
|
+
firmwareVersion, macAddress, modelId, modelName, productName, wampPort}`.
|
|
17
|
+
Other versions answer `{"error": "discovery request had unsupported version"}`.
|
|
18
|
+
|
|
19
|
+
## Transport
|
|
20
|
+
|
|
21
|
+
- WAMP v2, JSON serializer, WebSocket `ws://<host>:<wampPort>` (8001),
|
|
22
|
+
subprotocol `wamp.2.json`, realm `teufel`, no authentication.
|
|
23
|
+
- Router roles: broker + dealer. No meta API (`wamp.registration.*` missing).
|
|
24
|
+
- The device does not answer WebSocket pings: disable client pings.
|
|
25
|
+
- Only exact-match subscriptions deliver events.
|
|
26
|
+
|
|
27
|
+
## Conventions
|
|
28
|
+
|
|
29
|
+
- Property `X`: read with call `X.get` (no args, result `[value]`), write with
|
|
30
|
+
call `X.set` and the new value as the single positional argument
|
|
31
|
+
(`[value]`, scalar or JSON object), event on topic `X` with `[value]`.
|
|
32
|
+
- Actions are plain calls (`playback.pause`).
|
|
33
|
+
- Errors: `wamp.error.no_such_procedure`, `wamp.error.invalid_argument`,
|
|
34
|
+
`de.teufel.error.not_allowed`, `de.teufel.error.not_connected`, other
|
|
35
|
+
`de.teufel.error.*`.
|
|
36
|
+
|
|
37
|
+
## Properties (get/set/topic)
|
|
38
|
+
|
|
39
|
+
Verified = read on a STEREO M 2. Example values from that device.
|
|
40
|
+
|
|
41
|
+
| Name | Type / values | Verified |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| device.id | uuid string, read-only | yes |
|
|
44
|
+
| device.name | string (set) | yes |
|
|
45
|
+
| airplay.name | string | yes |
|
|
46
|
+
| audiocontrol.volume | int 0–100 (set); also `audiocontrol.volume.change` (delta) | yes |
|
|
47
|
+
| audiocontrol.mute | bool (set) | yes |
|
|
48
|
+
| audiocontrol.balance | int (set) | yes |
|
|
49
|
+
| audiocontrol.channel_configuration | `MainLeft` / `MainRight` (set) | yes |
|
|
50
|
+
| audiocontrol.connection.secondary | `Wired` / `Wireless` (set) | yes |
|
|
51
|
+
| audiocontrol.sound_modes.mono | bool (set) | yes |
|
|
52
|
+
| audiocontrol.eq.graphic.bands | list of `{id, gain, min, max, step}`; ids treble, mid, bass | yes |
|
|
53
|
+
| audiocontrol.eq.graphic.band | get takes band id (`["bass"]`) → gain; set takes `{id, gain}` (topic carries `{id, gain}`) | get yes |
|
|
54
|
+
| audiocontrol.eq.position_based.{primary,secondary}.desk | `OnStand` / `OnDesk` (set) | yes |
|
|
55
|
+
| audiocontrol.eq.position_based.{primary,secondary}.wall | `FreeStanding` / `Wall` / `Corner` (set) | yes |
|
|
56
|
+
| hmi.aux_gain | int (set) | yes |
|
|
57
|
+
| hmi.aux_signal_detection_sensitivity | int (set) | yes |
|
|
58
|
+
| hmi.brightness.top_elements | int 0–100 (set) | yes |
|
|
59
|
+
| hmi.brightness.status_indicator | int 0–100 (set) | yes |
|
|
60
|
+
| hmi.locked | bool (set) | yes |
|
|
61
|
+
| hmi.proximity_sensing | bool (set) | yes |
|
|
62
|
+
| hmi.sound_icons_enabled | bool (set) | yes |
|
|
63
|
+
| power.standby.state | `Active` / `Standby` | yes |
|
|
64
|
+
| power.standby.timeout | int seconds (set) | yes |
|
|
65
|
+
| power.auto_off.timeout | int (set) | yes |
|
|
66
|
+
| playback.source | TssdkSource (see below) | yes |
|
|
67
|
+
| playback.playback_state | `NoMediaPresent` / `Playing` / `Paused` / `Transitioning` / `Error` | yes |
|
|
68
|
+
| playback.metadata | `{title, subtitle, artist, album, playlist, station, duration (s), imageUrl (http on device port 8005 for AirPlay), albumImageUrl, sourceDevice, contextType, audioProperties{channels, samplerate, encodingFormat}}` | yes |
|
|
69
|
+
| playback.position | int seconds, event every second while playing; `not_allowed` for line sources | yes |
|
|
70
|
+
| playback.allowed_actions | list, e.g. `Pause`/`Resume`, `Next`, `Previous`, `Position` (seek needs its own entry) | yes |
|
|
71
|
+
| playback.repeat_mode | `Off` / … | yes |
|
|
72
|
+
| playback.shuffle_mode | `Off` / … | yes |
|
|
73
|
+
| playback.history | list of `{id, context, metadata, …}`; topics `.added/.removed/.changed` | yes |
|
|
74
|
+
| playback.presets | list of TssdkPreset `{id, name, source, context, metadata, timestamps{created, updated}}` | yes |
|
|
75
|
+
| playback.presets.slots | list (3 on STEREO M 2) of preset id or null; topic `playback.presets.slots.changed` | yes |
|
|
76
|
+
| spotify.active_device | bool | yes |
|
|
77
|
+
| spotify.username | string | yes |
|
|
78
|
+
| chromecast.version | string | yes |
|
|
79
|
+
| chromecast.tos.status | `Unknown` / `TosAccepted` / `TosNotAccepted` | yes |
|
|
80
|
+
| chromecast.usage_reports_enabled | bool (set) | yes |
|
|
81
|
+
| chromecast.user_setup.is_required | bool | yes |
|
|
82
|
+
| connectivity.connected_networks | list of `{bssid, channel, frequencyInMhz, security[], signalInPercent, ssid, type, v4address, v6address}` | yes |
|
|
83
|
+
| connectivity.signal_strength | int % | yes |
|
|
84
|
+
| connectivity.wifi.state / ethernet.state | `Connected` / `Disabled` / … | yes |
|
|
85
|
+
| connectivity.wifi.dhcp / ethernet.dhcp | `{isEnabled}` (set); ethernet `not_connected` when unplugged | yes |
|
|
86
|
+
| connectivity.bluetooth.devices | list of `{id, address, connectionState, name}`; states `AudioConnected` / `Connected` / `NotConnected` | yes |
|
|
87
|
+
| connectivity.bluetooth.discoverable | bool | yes |
|
|
88
|
+
| stereo_pairing.wireless.status | `{state, connected}` | yes |
|
|
89
|
+
| reporting.crash_report_mode | `Off` / `Full` / … (set) | yes |
|
|
90
|
+
| system.update.state | `Idle` / `CheckingForUpdate` / `Downloading` / `ReadyToInstall` / `AcPowerDisconnected` | yes |
|
|
91
|
+
| system.update.progress | int % | yes |
|
|
92
|
+
| system.update.last_update_status | e.g. `Success` | yes |
|
|
93
|
+
| system.update.channel | e.g. `Beta` | yes |
|
|
94
|
+
| system.update.version.installed | string | yes |
|
|
95
|
+
| system.update.version.pending | null or `{version, type, description}` | yes |
|
|
96
|
+
|
|
97
|
+
TssdkSource: `None, Uri, TuneIn, Hdmi, HdmiArc, Bluetooth, Spotify, Chromecast,
|
|
98
|
+
AirPlay, MyMusic, Aux, Optical, Tidal`. `playback.source.list` (call) returns the
|
|
99
|
+
ones a device supports.
|
|
100
|
+
|
|
101
|
+
## Actions (calls)
|
|
102
|
+
|
|
103
|
+
Verified on a STEREO M 2 (AirPlay): `playback.pause`, `playback.resume`,
|
|
104
|
+
`playback.next`, `playback.previous` (result `[null]`, state goes through
|
|
105
|
+
`Transitioning`; metadata event ~0.2 s later, cover URL may follow ~1 s later),
|
|
106
|
+
`power.standby.enter`, `power.standby.leave` (WebSocket stays connected in
|
|
107
|
+
standby; `power.standby.state` event fires immediately). `playback.seek` and
|
|
108
|
+
`playback.seek_relative` (int seconds) return `not_allowed` when
|
|
109
|
+
`allowed_actions` does not offer seeking (AirPlay). Every `X.set` of a property
|
|
110
|
+
above accepted the current value (no event is sent when nothing changes).
|
|
111
|
+
|
|
112
|
+
Not yet verified:
|
|
113
|
+
|
|
114
|
+
- Playback: `playback.pause`, `playback.resume`, `playback.next`,
|
|
115
|
+
`playback.previous`, `playback.seek` (int), `playback.seek_relative` (int).
|
|
116
|
+
- Sources: `playback.source.start.aux`, `.optical` (no args?),
|
|
117
|
+
`.uri` `{uri, startPosition}`, `.tunein` `{guideId, containerId, startPosition}`,
|
|
118
|
+
`.mymusic` `{path, startTrack, startPosition}`; Bluetooth context `{deviceId}`;
|
|
119
|
+
Spotify context `{contextUri, trackUri, shuffleMode, repeatMode, startPosition}`.
|
|
120
|
+
- Presets: `playback.presets.start` `{id, resume}`, `playback.presets.add`,
|
|
121
|
+
`playback.presets.add_current`, `playback.presets.slots.assign` `{slot, id}`,
|
|
122
|
+
`playback.presets.get_transient` (`not_allowed` when idle), `playback.history.start`.
|
|
123
|
+
- Bluetooth: `connectivity.bluetooth.connect`, `.disconnect`, `.devices.remove`,
|
|
124
|
+
`ux.bluetooth.connect`, `ux.bluetooth.enable_discoverability`,
|
|
125
|
+
`ux.bluetooth.disable_discoverability`.
|
|
126
|
+
- Volume via UI feedback path: `ux.audiocontrol.volume.set`, `ux.audiocontrol.volume.change`.
|
|
127
|
+
- Update: `system.update.check`, `system.update.accept`.
|
|
128
|
+
- Chromecast: `chromecast.tos.accept`, `chromecast.user_setup.finalize`.
|
|
129
|
+
- Pairing: `stereo_pairing.role.set` `{role, uid}`, `speaker_pairing.*` (other models).
|
|
130
|
+
- Other: `hmi.identify_left`, `hmi.identify_right` (not registered on the M 2;
|
|
131
|
+
probably actions), `reporting.generate_user_report` `{email, phone, feedback}`,
|
|
132
|
+
`content.mymusic.browse` (path argument format unknown).
|
|
133
|
+
|
|
134
|
+
## Other models (not registered on STEREO M 2)
|
|
135
|
+
|
|
136
|
+
`audiocontrol.{level(s), distance(s), delay, drc, dynamore, upmix,
|
|
137
|
+
dolby.virtualization, dts.virtualization, sound_modes.audio_mode}`,
|
|
138
|
+
`hmi.brightness.automatic_adjustment`, `speaker_pairing.*` — soundbar/surround features.
|
|
@@ -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 = "aiotssdk"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Async client for the local WAMP API of Teufel TSSDK audio devices (STEREO M 2, ...)"
|
|
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 = ["teufel", "tssdk", "wamp", "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/aiotssdk"
|
|
32
|
+
Issues = "https://github.com/nyxdis/aiotssdk/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/aiotssdk"]
|
|
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 = ["aiotssdk"]
|
|
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=aiotssdk --cov-report=term-missing --cov-fail-under=90"
|
|
83
|
+
|
|
84
|
+
[tool.coverage.run]
|
|
85
|
+
branch = true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"extends": [
|
|
4
|
+
"config:recommended",
|
|
5
|
+
":semanticCommits",
|
|
6
|
+
":maintainLockFilesMonthly",
|
|
7
|
+
"helpers:pinGitHubActionDigestsToSemver"
|
|
8
|
+
],
|
|
9
|
+
"timezone": "Europe/Berlin",
|
|
10
|
+
"schedule": ["before 6am on monday"],
|
|
11
|
+
"rangeStrategy": "update-lockfile",
|
|
12
|
+
"packageRules": [
|
|
13
|
+
{
|
|
14
|
+
"matchManagers": ["github-actions"],
|
|
15
|
+
"groupName": "GitHub Actions"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Async client for Teufel TSSDK audio devices."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
6
|
+
|
|
7
|
+
from .client import DEFAULT_PORT, TssdkClient
|
|
8
|
+
from .discovery import DISCOVERY_PORT, discover, get_device_info
|
|
9
|
+
from .exceptions import (
|
|
10
|
+
TssdkApiError,
|
|
11
|
+
TssdkConnectionError,
|
|
12
|
+
TssdkError,
|
|
13
|
+
TssdkInvalidArgumentError,
|
|
14
|
+
TssdkNoSuchProcedureError,
|
|
15
|
+
TssdkNotAllowedError,
|
|
16
|
+
)
|
|
17
|
+
from .models import CallResult, DeviceInfo, Event
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
__version__ = version("aiotssdk")
|
|
21
|
+
except PackageNotFoundError: # pragma: no cover
|
|
22
|
+
__version__ = "0.0.0"
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"DEFAULT_PORT",
|
|
26
|
+
"DISCOVERY_PORT",
|
|
27
|
+
"CallResult",
|
|
28
|
+
"DeviceInfo",
|
|
29
|
+
"Event",
|
|
30
|
+
"TssdkApiError",
|
|
31
|
+
"TssdkClient",
|
|
32
|
+
"TssdkConnectionError",
|
|
33
|
+
"TssdkError",
|
|
34
|
+
"TssdkInvalidArgumentError",
|
|
35
|
+
"TssdkNoSuchProcedureError",
|
|
36
|
+
"TssdkNotAllowedError",
|
|
37
|
+
"__version__",
|
|
38
|
+
"discover",
|
|
39
|
+
"get_device_info",
|
|
40
|
+
]
|