PyLoxone-Audio 0.1.5__tar.gz → 0.1.7__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.
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/API.md +13 -3
- pyloxone_audio-0.1.7/CHANGELOG.md +31 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/DIAGNOSTICS-REFERENCE.md +1 -1
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/MANIFEST.in +1 -1
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PKG-INFO +7 -3
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PyLoxone_Audio.egg-info/PKG-INFO +7 -3
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PyLoxone_Audio.egg-info/SOURCES.txt +11 -1
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/README.md +6 -2
- pyloxone_audio-0.1.7/RELEASE-NOTES-0.1.7.md +11 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/USER-GUIDE.md +3 -2
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/__init__.py +2 -2
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/diagnostic_events.py +1 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/grouping.py +11 -1
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/metadata.py +14 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/native.py +83 -15
- pyloxone_audio-0.1.7/pyloxone_audio/session.py +238 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyproject.toml +1 -1
- pyloxone_audio-0.1.7/tests/library/session_support.py +149 -0
- pyloxone_audio-0.1.7/tests/library/test_folder_echo_regression.py +91 -0
- pyloxone_audio-0.1.7/tests/library/test_reusable_command_session.py +70 -0
- pyloxone_audio-0.1.7/tests/library/test_room_absolute_rebase.py +78 -0
- pyloxone_audio-0.1.7/tests/library/test_session_benchmark.py +54 -0
- pyloxone_audio-0.1.7/tests/library/test_session_cancelled_close.py +34 -0
- pyloxone_audio-0.1.7/tests/library/test_session_isolation.py +152 -0
- pyloxone_audio-0.1.7/tests/library/test_session_owner_controls.py +124 -0
- pyloxone_audio-0.1.7/tests/library/test_session_playback_policy.py +52 -0
- pyloxone_audio-0.1.5/CHANGELOG.md +0 -18
- pyloxone_audio-0.1.5/RELEASE-NOTES-0.1.5.md +0 -8
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/AUTOMATION-GROUPING.md +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/DIAGNOSTICS.md +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/KNOWN-ISSUES.md +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/LICENSE +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/NOTICE.md +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PyLoxone_Audio.egg-info/dependency_links.txt +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PyLoxone_Audio.egg-info/requires.txt +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/PyLoxone_Audio.egg-info/top_level.txt +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/announcement.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/catalogue.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/clock.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/models.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/py.typed +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/radio.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/selection.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/pyloxone_audio/sources.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/setup.cfg +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/conftest.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/fixtures/audioserver/README.md +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/fixtures/audioserver/sebastian_alarm_end.txt +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/fixtures/audioserver/sebastian_loxone_radio.json +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/fixtures/audioserver/sebastian_tts.json +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/fixtures/audioserver/sebastian_tunein.json +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/pytest.ini +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audio_grouping.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audio_modes.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_announcement.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_connection.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_events.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_library_source.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_metadata.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_playback.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_seek.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_timing.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_audioserver_wire.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_automation_group_intent.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_boundary_environment.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_boundary_ownership.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_boundary_qualification.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_diagnostic_events.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_diagnostic_operations.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_diagnostic_request_kinds.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_diagnostic_timing.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_diagnostic_wire.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_distribution_dependencies.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_exact_track_start.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_group_commands.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_group_coordinator.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_group_planning.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_group_revocation_r1.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_group_transport.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_grouping_numeric_validation.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_playback_failure_recovery.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_portable_policies.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_published_authentication.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_restore_readiness.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_room_reply_review03.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_room_transport.py +0 -0
- {pyloxone_audio-0.1.5 → pyloxone_audio-0.1.7}/tests/library/test_volume_failure_recovery.py +0 -0
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
# PyLoxone-Audio 0.1.
|
|
1
|
+
# PyLoxone-Audio 0.1.7 — API and compatibility
|
|
2
|
+
|
|
3
|
+
## Command-session lifecycle
|
|
4
|
+
|
|
5
|
+
The 0.1.7 adapter explicitly enables `AudioServerCommands.reuse_session`. Direct library consumers retain the original one-shot default. One command owner belongs to one entry/server/current authentication lifetime; never share it between entries or accounts. The host publishes token revocation through `observe_authentication()` and awaits `async_close()` on unload. Changing host/options uses the existing unload/new-owner lifecycle, not mutation of an active owner's endpoint.
|
|
6
|
+
|
|
7
|
+
The reusable transport keeps the existing single-request lock, authentication/serializers and command proof. After authentication, one bounded-inbox reader owns receive. Unsolicited events are drained but are not metadata authority; command echoes must match the active command (including the vendor's search-query key convention). An uncertain, cancelled, timed-out, malformed or uncorrelated session is retired without replay. The native protocol has no demonstrated unique request ID for a delayed identical echo.
|
|
8
|
+
|
|
9
|
+
Mapped metadata bindings call `observe_playback(player_id, playing)` from native observations and revoke on removal/disconnect/stop. Positive playback has the same 30-second freshness bound as active metadata. Reconciler eligibility, source/group capability and operation fences remain separate: they must not suppress known mapped playback for retention. Any fresh playing room retains the session; after the last room stops or its lease expires, the monotonic idle allowance is five minutes. Meaningful commands renew activity; status reads and unsolicited/background frames do not. The entire request lease, including authentication, excludes idle expiry. Required reads may reconnect. Browse has no new outer lock and yields between native requests.
|
|
10
|
+
|
|
11
|
+
Diagnostics adds `session_reused` rather than inventing new connection/authentication stages for warm requests. `request_finished` still follows the actual request boundary. The Miniserver and metadata/event connections are separate and unchanged.
|
|
2
12
|
|
|
3
13
|
An Apache-2.0 Python library for native audio communication, consumed by the
|
|
4
|
-
existing PyLoxone integration. The matching reference adapter is 0.1.
|
|
14
|
+
existing PyLoxone integration. The matching reference adapter is 0.1.7
|
|
5
15
|
on stock PyLoxone 0.10.3. See [NOTICE.md](NOTICE.md) for attribution.
|
|
6
16
|
|
|
7
17
|
## Concrete public API and ownership
|
|
@@ -85,7 +95,7 @@ the supported enable/export workflow, exact bounds and evidence/privacy limits.
|
|
|
85
95
|
|
|
86
96
|
## Installation and host compatibility
|
|
87
97
|
|
|
88
|
-
Requires Python >=3.14. Install `PyLoxone-Audio==0.1.
|
|
98
|
+
Requires Python >=3.14. Install `PyLoxone-Audio==0.1.7` for standalone consumers.
|
|
89
99
|
Home Assistant users need the matching component and frontend described in the
|
|
90
100
|
[installation guide](https://github.com/davehocking/PyLoxone-Audio/blob/main/preview-build/README.md); HA installs Python dependencies.
|
|
91
101
|
Keep domain `loxone`, existing entries/entities and the exact compatible pin.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
- Matching library/adapter 0.1.7 and frontend r14.
|
|
6
|
+
- Nested Library browsing and native Core 2026.11.1 Group compatibility.
|
|
7
|
+
- Native room-only volume, explicit balanced group volume, follower controls and 300 ms tap batching.
|
|
8
|
+
|
|
9
|
+
## 0.1.6
|
|
10
|
+
|
|
11
|
+
- Reuse the entry-owned authenticated command connection to reduce warm command and catalogue wait-time.
|
|
12
|
+
- Keep fresh mapped playback sessions; otherwise expire after five minutes without meaningful activity.
|
|
13
|
+
- Retain request serialization, native proof, revocation and no-replay safeguards; unchanged r13 frontend.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 0.1.5
|
|
17
|
+
|
|
18
|
+
- Matching library and reference adapter 0.1.5 with frontend r13.
|
|
19
|
+
- Short installation and maintainer guides, with an upgrade from the previous public adapter.
|
|
20
|
+
|
|
21
|
+
## 0.1.4.post1
|
|
22
|
+
|
|
23
|
+
- Documentation and packaging revision of library 0.1.4, paired with reference adapter 0.1.4 and the exact library requirement `PyLoxone-Audio==0.1.4.post1`. Audio behaviour and frontend r12 are unchanged.
|
|
24
|
+
|
|
25
|
+
## 0.1.4
|
|
26
|
+
|
|
27
|
+
- Longer bounded feedback waits for large serially qualified audio groups.
|
|
28
|
+
- Full-width group/member volume sliders with percentage and −/+ controls.
|
|
29
|
+
- Original release: library 0.1.4, reference adapter 0.10.3.dev19 and frontend r12 on stock PyLoxone 0.10.3.
|
|
30
|
+
|
|
31
|
+
[Current release notes](https://github.com/davehocking/PyLoxone-Audio/blob/main/RELEASE-NOTES-0.1.7.md). Earlier releases remain in Git history and GitHub Releases.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Audio diagnostics and native Home Assistant tools
|
|
2
2
|
|
|
3
|
-
For library 0.1.
|
|
3
|
+
For library 0.1.7 and reference adapter 0.1.7. Start with the
|
|
4
4
|
[installation guide](https://github.com/davehocking/PyLoxone-Audio/blob/main/preview-build/README.md).
|
|
5
5
|
New users default OFF; existing saved preferences are preserved. Install the
|
|
6
6
|
matching adapter/library pair: installing only the wheel does not add the switch.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyLoxone-Audio
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Native audio transport and source policies for PyLoxone
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/davehocking/PyLoxone-Audio
|
|
@@ -20,7 +20,7 @@ Dynamic: license-file
|
|
|
20
20
|
|
|
21
21
|
Audio features for [PyLoxone](https://github.com/JoDehli/PyLoxone), using your existing Home Assistant integration and room players.
|
|
22
22
|
|
|
23
|
-
**Version 0.1.
|
|
23
|
+
**Version 0.1.7:** library **0.1.7**, reference adapter **0.1.7**, frontend **r14**, based on PyLoxone **0.10.3**. Install the matching preview below; Home Assistant resolves `PyLoxone-Audio==0.1.7` through its normal dependency handling. Installing the library alone does not update the integration.
|
|
24
24
|
|
|
25
25
|
## Start here
|
|
26
26
|
|
|
@@ -44,11 +44,15 @@ Despite its name, that option also enables Browse/Search, source selection and r
|
|
|
44
44
|
|
|
45
45
|
**Audio diagnostics** is a separate, optional switch. It does not enable playback.
|
|
46
46
|
|
|
47
|
+
## What changes in 0.1.7
|
|
48
|
+
|
|
49
|
+
Warm audio commands and Browse requests reuse an authenticated connection. This release also improves nested Local Library browsing, supports the native Group entry on Core 2026.11.1, and separates room volume from explicit whole-group volume. Rapid −/+ taps in the custom manager combine after a brief 300 ms pause. Cold setup and slow source replies can still take time. See the [release notes](https://github.com/davehocking/PyLoxone-Audio/blob/main/RELEASE-NOTES-0.1.7.md).
|
|
50
|
+
|
|
47
51
|
## What it adds
|
|
48
52
|
|
|
49
53
|
- Now-playing information and Browse/Search for supported native sources.
|
|
50
54
|
- Previous-source selection with remembered content and best-effort position return.
|
|
51
|
-
- Native audio groups through the player's **Join** control, with
|
|
55
|
+
- Native audio groups through the player's **Join** control, with separate group and room controls.
|
|
52
56
|
- Group music controls on the leader, with a link from followers to the leader's player.
|
|
53
57
|
- Grouping actions for automations and optional diagnostic downloads.
|
|
54
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyLoxone-Audio
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Native audio transport and source policies for PyLoxone
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/davehocking/PyLoxone-Audio
|
|
@@ -20,7 +20,7 @@ Dynamic: license-file
|
|
|
20
20
|
|
|
21
21
|
Audio features for [PyLoxone](https://github.com/JoDehli/PyLoxone), using your existing Home Assistant integration and room players.
|
|
22
22
|
|
|
23
|
-
**Version 0.1.
|
|
23
|
+
**Version 0.1.7:** library **0.1.7**, reference adapter **0.1.7**, frontend **r14**, based on PyLoxone **0.10.3**. Install the matching preview below; Home Assistant resolves `PyLoxone-Audio==0.1.7` through its normal dependency handling. Installing the library alone does not update the integration.
|
|
24
24
|
|
|
25
25
|
## Start here
|
|
26
26
|
|
|
@@ -44,11 +44,15 @@ Despite its name, that option also enables Browse/Search, source selection and r
|
|
|
44
44
|
|
|
45
45
|
**Audio diagnostics** is a separate, optional switch. It does not enable playback.
|
|
46
46
|
|
|
47
|
+
## What changes in 0.1.7
|
|
48
|
+
|
|
49
|
+
Warm audio commands and Browse requests reuse an authenticated connection. This release also improves nested Local Library browsing, supports the native Group entry on Core 2026.11.1, and separates room volume from explicit whole-group volume. Rapid −/+ taps in the custom manager combine after a brief 300 ms pause. Cold setup and slow source replies can still take time. See the [release notes](https://github.com/davehocking/PyLoxone-Audio/blob/main/RELEASE-NOTES-0.1.7.md).
|
|
50
|
+
|
|
47
51
|
## What it adds
|
|
48
52
|
|
|
49
53
|
- Now-playing information and Browse/Search for supported native sources.
|
|
50
54
|
- Previous-source selection with remembered content and best-effort position return.
|
|
51
|
-
- Native audio groups through the player's **Join** control, with
|
|
55
|
+
- Native audio groups through the player's **Join** control, with separate group and room controls.
|
|
52
56
|
- Group music controls on the leader, with a link from followers to the leader's player.
|
|
53
57
|
- Grouping actions for automations and optional diagnostic downloads.
|
|
54
58
|
|
|
@@ -8,7 +8,7 @@ LICENSE
|
|
|
8
8
|
MANIFEST.in
|
|
9
9
|
NOTICE.md
|
|
10
10
|
README.md
|
|
11
|
-
RELEASE-NOTES-0.1.
|
|
11
|
+
RELEASE-NOTES-0.1.7.md
|
|
12
12
|
USER-GUIDE.md
|
|
13
13
|
pyproject.toml
|
|
14
14
|
PyLoxone_Audio.egg-info/PKG-INFO
|
|
@@ -28,9 +28,11 @@ pyloxone_audio/native.py
|
|
|
28
28
|
pyloxone_audio/py.typed
|
|
29
29
|
pyloxone_audio/radio.py
|
|
30
30
|
pyloxone_audio/selection.py
|
|
31
|
+
pyloxone_audio/session.py
|
|
31
32
|
pyloxone_audio/sources.py
|
|
32
33
|
tests/library/conftest.py
|
|
33
34
|
tests/library/pytest.ini
|
|
35
|
+
tests/library/session_support.py
|
|
34
36
|
tests/library/test_audio_grouping.py
|
|
35
37
|
tests/library/test_audio_modes.py
|
|
36
38
|
tests/library/test_audioserver_announcement.py
|
|
@@ -53,6 +55,7 @@ tests/library/test_diagnostic_timing.py
|
|
|
53
55
|
tests/library/test_diagnostic_wire.py
|
|
54
56
|
tests/library/test_distribution_dependencies.py
|
|
55
57
|
tests/library/test_exact_track_start.py
|
|
58
|
+
tests/library/test_folder_echo_regression.py
|
|
56
59
|
tests/library/test_group_commands.py
|
|
57
60
|
tests/library/test_group_coordinator.py
|
|
58
61
|
tests/library/test_group_planning.py
|
|
@@ -63,8 +66,15 @@ tests/library/test_playback_failure_recovery.py
|
|
|
63
66
|
tests/library/test_portable_policies.py
|
|
64
67
|
tests/library/test_published_authentication.py
|
|
65
68
|
tests/library/test_restore_readiness.py
|
|
69
|
+
tests/library/test_reusable_command_session.py
|
|
70
|
+
tests/library/test_room_absolute_rebase.py
|
|
66
71
|
tests/library/test_room_reply_review03.py
|
|
67
72
|
tests/library/test_room_transport.py
|
|
73
|
+
tests/library/test_session_benchmark.py
|
|
74
|
+
tests/library/test_session_cancelled_close.py
|
|
75
|
+
tests/library/test_session_isolation.py
|
|
76
|
+
tests/library/test_session_owner_controls.py
|
|
77
|
+
tests/library/test_session_playback_policy.py
|
|
68
78
|
tests/library/test_volume_failure_recovery.py
|
|
69
79
|
tests/library/fixtures/audioserver/README.md
|
|
70
80
|
tests/library/fixtures/audioserver/sebastian_alarm_end.txt
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Audio features for [PyLoxone](https://github.com/JoDehli/PyLoxone), using your existing Home Assistant integration and room players.
|
|
4
4
|
|
|
5
|
-
**Version 0.1.
|
|
5
|
+
**Version 0.1.7:** library **0.1.7**, reference adapter **0.1.7**, frontend **r14**, based on PyLoxone **0.10.3**. Install the matching preview below; Home Assistant resolves `PyLoxone-Audio==0.1.7` through its normal dependency handling. Installing the library alone does not update the integration.
|
|
6
6
|
|
|
7
7
|
## Start here
|
|
8
8
|
|
|
@@ -26,11 +26,15 @@ Despite its name, that option also enables Browse/Search, source selection and r
|
|
|
26
26
|
|
|
27
27
|
**Audio diagnostics** is a separate, optional switch. It does not enable playback.
|
|
28
28
|
|
|
29
|
+
## What changes in 0.1.7
|
|
30
|
+
|
|
31
|
+
Warm audio commands and Browse requests reuse an authenticated connection. This release also improves nested Local Library browsing, supports the native Group entry on Core 2026.11.1, and separates room volume from explicit whole-group volume. Rapid −/+ taps in the custom manager combine after a brief 300 ms pause. Cold setup and slow source replies can still take time. See the [release notes](https://github.com/davehocking/PyLoxone-Audio/blob/main/RELEASE-NOTES-0.1.7.md).
|
|
32
|
+
|
|
29
33
|
## What it adds
|
|
30
34
|
|
|
31
35
|
- Now-playing information and Browse/Search for supported native sources.
|
|
32
36
|
- Previous-source selection with remembered content and best-effort position return.
|
|
33
|
-
- Native audio groups through the player's **Join** control, with
|
|
37
|
+
- Native audio groups through the player's **Join** control, with separate group and room controls.
|
|
34
38
|
- Group music controls on the leader, with a link from followers to the leader's player.
|
|
35
39
|
- Grouping actions for automations and optional diagnostic downloads.
|
|
36
40
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# PyLoxone-Audio 0.1.7
|
|
2
|
+
|
|
3
|
+
Library **0.1.7**, reference adapter **0.1.7**, exact `PyLoxone-Audio==0.1.7`, frontend **r14**, based on PyLoxone **0.10.3**. Update both integration files and frontend; a library install alone does not replace them.
|
|
4
|
+
|
|
5
|
+
- Reuse authenticated command sessions for warm controls and sequential Browse requests.
|
|
6
|
+
- Improve nested Local Library browsing and native Group compatibility with Core 2026.11.1.
|
|
7
|
+
- Keep standard player volume room-only; use the custom manager's explicit **Group volume** to adjust the group while retaining room balance, subject to volume limits.
|
|
8
|
+
- Combine rapid custom-manager −/+ taps after a brief 300 ms pause.
|
|
9
|
+
- Provide supported follower mode controls and clearer volume errors.
|
|
10
|
+
|
|
11
|
+
[Install, upgrade and roll back](https://github.com/davehocking/PyLoxone-Audio/blob/main/preview-build/README.md) · [User guide](USER-GUIDE.md) · [Current limits](KNOWN-ISSUES.md)
|
|
@@ -26,12 +26,13 @@ Only Loxone-managed audio rooms are offered. This manager supports dynamic group
|
|
|
26
26
|
| Control | Effect |
|
|
27
27
|
|---|---|
|
|
28
28
|
| Grouped player's standard play/pause or manager's top play/pause | Whole group |
|
|
29
|
-
|
|
|
29
|
+
| Room player's standard volume slider or volume up/down | That room only, whether leader or follower |
|
|
30
|
+
| Custom manager's **Group volume** slider | Whole group, keeping the rooms' volume balance until a limit is reached |
|
|
30
31
|
| Each room row's play/pause or volume | That room only, including the leader's row |
|
|
31
32
|
| Leader Browse, Source or supported seeking | Shared group music |
|
|
32
33
|
| Follower's **Media controls on <leader name>** link | Opens the current leader's player |
|
|
33
34
|
|
|
34
|
-
Use the leader to change the group's music. Shuffle/Repeat
|
|
35
|
+
Use the leader to change the group's music. Supported Shuffle/Repeat controls on a follower change the current leader's modes; idle followers get matching native-style buttons without pretending they are playing. Each volume slider occupies its own full-width line, with percentage and −/+ controls above it. Group volume shows the rounded mean of room levels; it is not a command to give every room the same volume. Startup/resume volume behaviour remains native to Loxone. Rapid −/+ taps in the custom manager are combined after a 300 ms pause; wait for confirmation before another operation.
|
|
35
36
|
|
|
36
37
|
## Automations and troubleshooting
|
|
37
38
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Concrete PyLoxone-Audio API, independent of Home Assistant.
|
|
3
3
|
|
|
4
|
-
Apache-2.0. Version 0.1.
|
|
4
|
+
Apache-2.0. Version 0.1.7.
|
|
5
5
|
The historical fake-backed facade contract is outside this distribution.
|
|
6
6
|
"""
|
|
7
|
-
__version__ = "0.1.
|
|
7
|
+
__version__ = "0.1.7"
|
|
8
8
|
|
|
9
9
|
from .announcement import async_send_prepared_announcement
|
|
10
10
|
from .catalogue import AudioCatalogue, CatalogueTarget, ConfiguredSource
|
|
@@ -554,12 +554,16 @@ class AudioGroupCoordinator:
|
|
|
554
554
|
self._tasks.add(task)
|
|
555
555
|
sent_targets, confirmed = {}, set()
|
|
556
556
|
valid, sent, completed, acquired = True, False, False, False
|
|
557
|
+
# An absolute ROOM target has no pre-lock volume prerequisite. Keep
|
|
558
|
+
# every initiating non-volume observer live while earlier work settles;
|
|
559
|
+
# GROUP retains its original additive plan and stale-volume predicate.
|
|
560
|
+
volume_armed = not room_only
|
|
557
561
|
|
|
558
562
|
def current():
|
|
559
563
|
nonlocal valid
|
|
560
564
|
valid = bool(valid and request_current() and qualified()
|
|
561
565
|
and not self.uncertain and before == _group_signature(self.snapshot)
|
|
562
|
-
and all(read(p) in ({targets[p]} if p in confirmed else {initial[p], sent_targets.get(p, initial[p])}) for p in players))
|
|
566
|
+
and (not volume_armed or all(read(p) in ({targets[p]} if p in confirmed else {initial[p], sent_targets.get(p, initial[p])}) for p in players)))
|
|
563
567
|
return valid
|
|
564
568
|
|
|
565
569
|
self._requests.add(current)
|
|
@@ -567,6 +571,12 @@ class AudioGroupCoordinator:
|
|
|
567
571
|
async with asyncio.timeout(self.timeout) as deadline, self._lock:
|
|
568
572
|
if not current():
|
|
569
573
|
raise AudioCommandError("Volume request superseded")
|
|
574
|
+
if room_only:
|
|
575
|
+
initial = {target: read(target)}
|
|
576
|
+
if mean_volume_percent(list(initial.values())) is None:
|
|
577
|
+
raise AudioCommandError("Current room volume feedback required")
|
|
578
|
+
targets = {target: percent}
|
|
579
|
+
volume_armed = True
|
|
570
580
|
self._scope, self._context, self._conflict = frozenset(players), self.context(), False
|
|
571
581
|
self._transport_before = before
|
|
572
582
|
acquired = True
|
|
@@ -99,6 +99,8 @@ class AudioMetadataCoordinator:
|
|
|
99
99
|
for task in tuple(self._recoveries.values()):
|
|
100
100
|
task.cancel()
|
|
101
101
|
await asyncio.gather(*tuple(self._recoveries.values()), return_exceptions=True)
|
|
102
|
+
for player, binding in self._bindings.items():
|
|
103
|
+
binding[0].observe_playback(player, False)
|
|
102
104
|
self._bindings.clear()
|
|
103
105
|
self._playing.clear()
|
|
104
106
|
self._active_since.clear()
|
|
@@ -179,6 +181,7 @@ class AudioMetadataCoordinator:
|
|
|
179
181
|
def remove() -> None:
|
|
180
182
|
if self._bindings.get(player_id) is binding:
|
|
181
183
|
del self._bindings[player_id]
|
|
184
|
+
commands.observe_playback(player_id, False)
|
|
182
185
|
self.set_playing(player_id, False)
|
|
183
186
|
|
|
184
187
|
return remove
|
|
@@ -455,6 +458,17 @@ class AudioMetadataCoordinator:
|
|
|
455
458
|
|
|
456
459
|
def _on_update(self, updates: tuple[AudioZoneMetadata, ...]) -> None:
|
|
457
460
|
"""Notify affected players; an empty update invalidates every snapshot."""
|
|
461
|
+
# Only exact opted-in mapped bindings qualify retention. This does not
|
|
462
|
+
# alter content/permission freshness, source proof or recovery policy.
|
|
463
|
+
if not updates:
|
|
464
|
+
for player, binding in self._bindings.items():
|
|
465
|
+
binding[0].observe_playback(player, False)
|
|
466
|
+
for row in updates:
|
|
467
|
+
if binding := self._bindings.get(row.player_id):
|
|
468
|
+
# Reconciler eligibility includes source/group/operation fences;
|
|
469
|
+
# those do not make a mapped room's positive playback unknown.
|
|
470
|
+
# Binding removal/stop owns retention invalidation separately.
|
|
471
|
+
binding[0].observe_playback(row.player_id, row.native_mode == "play")
|
|
458
472
|
if diagnostics_enabled(self.diagnostics):
|
|
459
473
|
if not updates:
|
|
460
474
|
diagnostic_event(
|
|
@@ -15,7 +15,7 @@ import base64
|
|
|
15
15
|
import json
|
|
16
16
|
import logging
|
|
17
17
|
import re
|
|
18
|
-
from contextlib import suppress
|
|
18
|
+
from contextlib import asynccontextmanager, suppress
|
|
19
19
|
from dataclasses import dataclass, field, replace
|
|
20
20
|
from datetime import UTC, datetime
|
|
21
21
|
from enum import IntEnum
|
|
@@ -30,6 +30,8 @@ from uuid import uuid4
|
|
|
30
30
|
from weakref import WeakSet
|
|
31
31
|
|
|
32
32
|
from .diagnostic_events import diagnostic_event, diagnostics_enabled
|
|
33
|
+
from .session import CommandSession
|
|
34
|
+
from . import session as session_policy
|
|
33
35
|
|
|
34
36
|
from Crypto.Cipher import AES, PKCS1_v1_5
|
|
35
37
|
from Crypto.PublicKey import RSA
|
|
@@ -389,6 +391,11 @@ class AudioServerCommands:
|
|
|
389
391
|
self._lock = asyncio.Lock()
|
|
390
392
|
self._closed = False
|
|
391
393
|
self._socket: Any = None
|
|
394
|
+
# The HA entry opts in explicitly; direct 0.1.x callers retain the
|
|
395
|
+
# original one-shot lifecycle unless they select reusable sessions.
|
|
396
|
+
self.reuse_session = False
|
|
397
|
+
self._session: CommandSession | None = None
|
|
398
|
+
self._playback_until: dict[int, float] = {}
|
|
392
399
|
self.diagnostics = diagnostics
|
|
393
400
|
self.announcement_fences: dict[int, Callable[[], None]] = {}
|
|
394
401
|
self.source_fences: dict[int, Callable[[], None]] = {}
|
|
@@ -424,15 +431,70 @@ class AudioServerCommands:
|
|
|
424
431
|
"""Latch published revocation without retaining token publication data."""
|
|
425
432
|
for current in tuple(self._authentication_guards):
|
|
426
433
|
current()
|
|
434
|
+
if self._session is not None and not self._session.valid():
|
|
435
|
+
self._session.invalidate()
|
|
436
|
+
|
|
437
|
+
def observe_playback(self, player_id: int, playing: bool) -> None:
|
|
438
|
+
"""Receive already-mapped native observations; silence expires in 30s."""
|
|
439
|
+
now = session_policy.monotonic()
|
|
440
|
+
self._playback_until = {p: end for p, end in self._playback_until.items() if end > now}
|
|
441
|
+
if playing is True and not self._closed:
|
|
442
|
+
self._playback_until[player_id] = now + 30
|
|
443
|
+
else:
|
|
444
|
+
self._playback_until.pop(player_id, None)
|
|
445
|
+
if self._session is not None:
|
|
446
|
+
self._session.observe_playing(max(self._playback_until.values(), default=0))
|
|
427
447
|
|
|
428
448
|
async def async_close(self) -> None:
|
|
429
449
|
"""Reject queued/future requests and close an in-flight owned socket."""
|
|
430
450
|
self._closed = True
|
|
451
|
+
self._playback_until.clear()
|
|
431
452
|
for release in (*tuple(self.announcement_fences.values()), *tuple(self.source_fences.values())):
|
|
432
453
|
release()
|
|
433
|
-
if self.
|
|
454
|
+
if self._session is not None:
|
|
455
|
+
await self._session.close()
|
|
456
|
+
self._session = None
|
|
457
|
+
elif self._socket is not None:
|
|
434
458
|
await self._socket.close()
|
|
435
459
|
|
|
460
|
+
@asynccontextmanager
|
|
461
|
+
async def _connection(self):
|
|
462
|
+
"""Lease one session under _lock; uncertain requests never remain warm."""
|
|
463
|
+
def context():
|
|
464
|
+
return connect(
|
|
465
|
+
self._uri, subprotocols=[Subprotocol("remotecontrol")],
|
|
466
|
+
open_timeout=self._timeout, close_timeout=2, ping_interval=None,
|
|
467
|
+
max_size=1024 * 1024, **_DIRECT_CONNECT,
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
if not self.reuse_session:
|
|
471
|
+
async with context() as socket:
|
|
472
|
+
yield socket
|
|
473
|
+
return
|
|
474
|
+
session = self._session
|
|
475
|
+
if session is not None and not session.valid():
|
|
476
|
+
await session.close()
|
|
477
|
+
if self._session is session:
|
|
478
|
+
self._session = None
|
|
479
|
+
session = None
|
|
480
|
+
if session is None:
|
|
481
|
+
current = self.authentication_guard()
|
|
482
|
+
manager = context()
|
|
483
|
+
socket = await manager.__aenter__()
|
|
484
|
+
session = self._session = CommandSession(socket, manager, current, AudioCommandError)
|
|
485
|
+
session.observe_playing(max(self._playback_until.values(), default=0))
|
|
486
|
+
try:
|
|
487
|
+
session.begin()
|
|
488
|
+
yield session
|
|
489
|
+
except BaseException:
|
|
490
|
+
session.invalidate()
|
|
491
|
+
raise
|
|
492
|
+
finally:
|
|
493
|
+
if not session.finish():
|
|
494
|
+
await session.close()
|
|
495
|
+
if self._session is session:
|
|
496
|
+
self._session = None
|
|
497
|
+
|
|
436
498
|
async def async_execute(
|
|
437
499
|
self, player_id: object, action: str, *, is_current: Callable[[], bool] | None = None,
|
|
438
500
|
on_send: Callable[[], None] | None = None, guard_cleanup: bool = False,
|
|
@@ -1083,8 +1145,14 @@ class AudioServerCommands:
|
|
|
1083
1145
|
# waiting for the existing shared lock or handshake. Other native
|
|
1084
1146
|
# routes retain their established transport/ownership behaviour.
|
|
1085
1147
|
status_credentials = self._credentials() if reply_key in ("status_result", "dgroup_update_result", "grouped_play_result", "grouped_pause_result") else None
|
|
1148
|
+
# A reusable-session request owns the authentication lifetime from
|
|
1149
|
+
# admission, including time spent queued behind another room. A
|
|
1150
|
+
# published A→B→A must not create a fresh authority for that intent.
|
|
1151
|
+
request_authentication = self.authentication_guard() if self.reuse_session else None
|
|
1086
1152
|
async with asyncio.timeout(self._timeout), self._lock:
|
|
1087
1153
|
record("lock_acquired")
|
|
1154
|
+
if request_authentication is not None and not request_authentication():
|
|
1155
|
+
raise AudioCommandError("Native command authentication changed while queued")
|
|
1088
1156
|
if self._closed:
|
|
1089
1157
|
message = "Audio playback connection is closed"
|
|
1090
1158
|
raise AudioCommandError(message)
|
|
@@ -1092,23 +1160,23 @@ class AudioServerCommands:
|
|
|
1092
1160
|
if not isinstance(username, str) or not username.strip() or not isinstance(token, str) or not token:
|
|
1093
1161
|
message = "Audio playback credentials are unavailable"
|
|
1094
1162
|
raise AudioCommandError(message)
|
|
1095
|
-
async with
|
|
1096
|
-
self._uri,
|
|
1097
|
-
subprotocols=[Subprotocol("remotecontrol")],
|
|
1098
|
-
open_timeout=self._timeout,
|
|
1099
|
-
close_timeout=2,
|
|
1100
|
-
ping_interval=None,
|
|
1101
|
-
max_size=1024 * 1024,
|
|
1102
|
-
**_DIRECT_CONNECT,
|
|
1103
|
-
) as socket:
|
|
1163
|
+
async with self._connection() as socket:
|
|
1104
1164
|
owned_socket = self._socket = socket
|
|
1105
|
-
|
|
1165
|
+
reused = isinstance(socket, CommandSession) and socket.authenticated
|
|
1166
|
+
if not reused:
|
|
1167
|
+
record("connection_opened")
|
|
1106
1168
|
if self._closed:
|
|
1107
1169
|
message = "Audio playback connection is closed"
|
|
1108
1170
|
raise AudioCommandError(message)
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
record("
|
|
1171
|
+
if reused:
|
|
1172
|
+
shuffle_switch = socket.shuffle_switch
|
|
1173
|
+
record("session_reused")
|
|
1174
|
+
else:
|
|
1175
|
+
shuffle_switch = await self._authenticate(socket, username, token)
|
|
1176
|
+
if isinstance(socket, CommandSession):
|
|
1177
|
+
socket.start_reader(shuffle_switch)
|
|
1178
|
+
if diagnostics_enabled(observer):
|
|
1179
|
+
record("authenticated")
|
|
1112
1180
|
|
|
1113
1181
|
if self._closed:
|
|
1114
1182
|
message = "Audio playback connection is closed"
|