PyLoxone-Audio 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.
- pyloxone_audio-0.1.0/API.md +86 -0
- pyloxone_audio-0.1.0/LICENSE +201 -0
- pyloxone_audio-0.1.0/MANIFEST.in +13 -0
- pyloxone_audio-0.1.0/NOTICE.md +15 -0
- pyloxone_audio-0.1.0/PKG-INFO +138 -0
- pyloxone_audio-0.1.0/PyLoxone_Audio.egg-info/PKG-INFO +138 -0
- pyloxone_audio-0.1.0/PyLoxone_Audio.egg-info/SOURCES.txt +45 -0
- pyloxone_audio-0.1.0/PyLoxone_Audio.egg-info/dependency_links.txt +1 -0
- pyloxone_audio-0.1.0/PyLoxone_Audio.egg-info/requires.txt +3 -0
- pyloxone_audio-0.1.0/PyLoxone_Audio.egg-info/top_level.txt +1 -0
- pyloxone_audio-0.1.0/README.md +120 -0
- pyloxone_audio-0.1.0/SPOTIFY.md +260 -0
- pyloxone_audio-0.1.0/pyloxone_audio/__init__.py +90 -0
- pyloxone_audio-0.1.0/pyloxone_audio/announcement.py +101 -0
- pyloxone_audio-0.1.0/pyloxone_audio/catalogue.py +1118 -0
- pyloxone_audio-0.1.0/pyloxone_audio/clock.py +7 -0
- pyloxone_audio-0.1.0/pyloxone_audio/metadata.py +98 -0
- pyloxone_audio-0.1.0/pyloxone_audio/models.py +48 -0
- pyloxone_audio-0.1.0/pyloxone_audio/native.py +1136 -0
- pyloxone_audio-0.1.0/pyloxone_audio/py.typed +0 -0
- pyloxone_audio-0.1.0/pyloxone_audio/radio.py +211 -0
- pyloxone_audio-0.1.0/pyloxone_audio/selection.py +194 -0
- pyloxone_audio-0.1.0/pyloxone_audio/sources.py +739 -0
- pyloxone_audio-0.1.0/pyloxone_audio/spotify.py +88 -0
- pyloxone_audio-0.1.0/pyproject.toml +25 -0
- pyloxone_audio-0.1.0/setup.cfg +4 -0
- pyloxone_audio-0.1.0/tests/library/conftest.py +32 -0
- pyloxone_audio-0.1.0/tests/library/fixtures/audioserver/README.md +25 -0
- pyloxone_audio-0.1.0/tests/library/fixtures/audioserver/sebastian_alarm_end.txt +16 -0
- pyloxone_audio-0.1.0/tests/library/fixtures/audioserver/sebastian_loxone_radio.json +29 -0
- pyloxone_audio-0.1.0/tests/library/fixtures/audioserver/sebastian_tts.json +27 -0
- pyloxone_audio-0.1.0/tests/library/fixtures/audioserver/sebastian_tunein.json +30 -0
- pyloxone_audio-0.1.0/tests/library/pytest.ini +4 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_announcement.py +88 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_connection.py +195 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_events.py +300 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_library_source.py +29 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_metadata.py +217 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_playback.py +259 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_seek.py +144 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_timing.py +148 -0
- pyloxone_audio-0.1.0/tests/library/test_audioserver_wire.py +168 -0
- pyloxone_audio-0.1.0/tests/library/test_boundary_environment.py +153 -0
- pyloxone_audio-0.1.0/tests/library/test_boundary_ownership.py +10 -0
- pyloxone_audio-0.1.0/tests/library/test_boundary_qualification.py +122 -0
- pyloxone_audio-0.1.0/tests/library/test_distribution_dependencies.py +28 -0
- pyloxone_audio-0.1.0/tests/library/test_portable_policies.py +33 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# PyLoxone-Audio 0.1.0 — local release candidate
|
|
2
|
+
|
|
3
|
+
A separately installable Apache-2.0 Python library containing the concrete native
|
|
4
|
+
audio implementation used by one existing PyLoxone integration. This is not a
|
|
5
|
+
second integration, new login, facade-only prototype, published index version or
|
|
6
|
+
claim of upstream automatic adoption. See NOTICE.md for attribution/provenance.
|
|
7
|
+
|
|
8
|
+
## Concrete public API and ownership
|
|
9
|
+
|
|
10
|
+
The explicit exports in pyloxone_audio/__init__.py are the public API:
|
|
11
|
+
|
|
12
|
+
- AudioServerCommands(host, current_credentials) owns bounded native command
|
|
13
|
+
authentication, correlation, cancellation, close and uncertain-write fences.
|
|
14
|
+
The callback supplies the current username/token; there is no token persistence.
|
|
15
|
+
- AudioServerListener and AudioEventReceiver receive/parse exact-player metadata;
|
|
16
|
+
AudioZoneMetadata is the neutral snapshot. AudioMetadataCoordinator supports
|
|
17
|
+
exact-player subscriptions, optional host task scheduling, start and awaited stop.
|
|
18
|
+
- AudioCatalogue(commands, player_id), CatalogueTarget, ConfiguredSource and
|
|
19
|
+
AudioFavourite own discovery, opaque browser targets, last-good source history,
|
|
20
|
+
configured favourites, provider/account qualification and neutral search values.
|
|
21
|
+
- MediaNode, SearchResult and MediaKind contain no HA entity or UI dependency.
|
|
22
|
+
- async_select_catalogue, async_select_favourite, async_select_radio_station and
|
|
23
|
+
async_native_catalogue_noop own source dispatch, settlement and fresh exact-room
|
|
24
|
+
provider feedback. Browser selection remains strict exact-item proof. Source
|
|
25
|
+
return does not require matching an obsolete historical track, and may attempt
|
|
26
|
+
at most one optional best-effort position restore. Optional failure does not
|
|
27
|
+
undo confirmed playback; a fixed warning is emitted, never exception payloads.
|
|
28
|
+
- async_source_route and async_optional_native_resume own native/retained routing
|
|
29
|
+
and safety decisions; NativeResumeOutcome, SourceRoute and
|
|
30
|
+
SourceContentRequiredError describe their outcomes. Hosts provide lifecycle/
|
|
31
|
+
newest-request liveness callbacks, snapshot bootstrap and their existing optional
|
|
32
|
+
linked-session bridge. UNAVAILABLE is not permission to ignore changed native
|
|
33
|
+
identity or uncertain writes. No blind fallback, replay or retry is introduced.
|
|
34
|
+
- manual_seek_supported, manual_seek_position, native_track_identity,
|
|
35
|
+
ManualSeekQualification and async_seek_track retain strict current-track/manual
|
|
36
|
+
seek capability, account/identity, echo and observed-progress qualification.
|
|
37
|
+
- passive_history_eligible and confirmed_library_session own reusable native
|
|
38
|
+
history eligibility. Genuine ordered observed feedback is distinct from intent.
|
|
39
|
+
- SpotifySessionBridge, SpotifyNativeSession, NativeSessionUnavailableError and
|
|
40
|
+
async_resume_native_session consume the host's optional existing read-only
|
|
41
|
+
linked Spotify session. Spotify owns session/queue; no queue reconstruction or
|
|
42
|
+
abandoned explicit HA Spotify handover feature is added.
|
|
43
|
+
- async_send_prepared_announcement handles prepared bounded WAV bytes through
|
|
44
|
+
the native event operation; the host supplies an existing lazy HTTP session.
|
|
45
|
+
- audioserver_uri and parse_audio_events retain their concrete native semantics.
|
|
46
|
+
|
|
47
|
+
SourceEnvironment(clock=callable) is immutable per-consumer clock configuration.
|
|
48
|
+
Pass environment= to source/seek/routing/Spotify functions when injecting a clock.
|
|
49
|
+
The callable must return aware UTC datetimes in the metadata.received_at domain.
|
|
50
|
+
The default is the library's aware UTC clock, not HA or another consumer's state.
|
|
51
|
+
Its async_observed_change method executes the concrete native settlement algorithm;
|
|
52
|
+
asyncio deadlines remain monotonic. No process-wide clock replacement is required.
|
|
53
|
+
|
|
54
|
+
The host retains HA setup/entities/registries/services, newest-request tasks and
|
|
55
|
+
unload cancellation, account locks/OAuth storage, error translation, artwork and
|
|
56
|
+
HA media/TTS preparation. It must keep liveness checks valid across awaits, drain
|
|
57
|
+
owned tasks before teardown and close commands before metadata/token owners.
|
|
58
|
+
ManualSeekQualification must be checked against actual current native metadata
|
|
59
|
+
and the host revision/duration, not merely a cached UI value. Optional native
|
|
60
|
+
completion requires settled dispatch and fresh exact-room/provider/account proof.
|
|
61
|
+
|
|
62
|
+
## Development tracing excluded
|
|
63
|
+
|
|
64
|
+
There is no shipped diagnostics module, SourceDiagnostics, snapshot/collector
|
|
65
|
+
API, source-stage logger, trace decorator, last_source_failure attribute or
|
|
66
|
+
compatibility no-op. Those pre-release development-only interfaces are intentionally
|
|
67
|
+
removed before this first 0.1.0 cutoff. Functional native dispatch callbacks,
|
|
68
|
+
source/announcement fences, clocks and cancellation remain. Ordinary fixed
|
|
69
|
+
warning/error logs and actual exception propagation/HA translation remain.
|
|
70
|
+
|
|
71
|
+
## Tested boundary and installation
|
|
72
|
+
|
|
73
|
+
Only the canonical Python 3.14.7 / HA 2026.9.1 / websockets 15.0.1 /
|
|
74
|
+
pycryptodome 4.0.1 / aiohttp 3.14.3 environment is exercised here. The metadata
|
|
75
|
+
requires Python >=3.14 but is not a wider tested compatibility promise. HA-free
|
|
76
|
+
portable runs explicitly reject HA imports. External I/O in tests is synthetic;
|
|
77
|
+
AF_UNIX wire tests use actual websocket/crypto implementations with TCP blocked.
|
|
78
|
+
No all-version/firmware/room, physical playback or adapter hardware claim follows.
|
|
79
|
+
|
|
80
|
+
For offline local installation use the supplied exact wheel with --no-index,
|
|
81
|
+
--find-links pointing to its local assets directory, and PyLoxone-Audio==0.1.0.
|
|
82
|
+
The supplied host manifest pins exactly that version, retaining integration domain
|
|
83
|
+
loxone, name PyLoxone and integration version 0.10.2. Existing dependencies must
|
|
84
|
+
already be available, or be provided independently offline; --no-deps validates
|
|
85
|
+
artifact identity only, not public dependency resolution. No PyPI lookup,
|
|
86
|
+
publication, namespace reservation, HA deployment or upstream uptake is implied.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Keep complete integration previews out of Python source distributions.
|
|
2
|
+
prune preview-build
|
|
3
|
+
prune checks
|
|
4
|
+
prune adapters
|
|
5
|
+
prune tools
|
|
6
|
+
prune tests/adapter
|
|
7
|
+
include API.md
|
|
8
|
+
include NOTICE.md
|
|
9
|
+
include LICENSE
|
|
10
|
+
include README.md
|
|
11
|
+
include SPOTIFY.md
|
|
12
|
+
prune tests/release
|
|
13
|
+
recursive-include tests/library *.py *.ini *.json *.txt *.md
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Provenance and licence — concrete offline extraction
|
|
2
|
+
|
|
3
|
+
This local 0.1.0 release candidate is supplied under Apache-2.0. `LICENSE` is copied verbatim from the local PyLoxone repository's Apache License, Version 2.0 file. No package has been published or registered. The library's 0.1.0 metadata and exact local host dependency are not a public index release or installed production change.
|
|
4
|
+
|
|
5
|
+
The HA entry ownership, exact-player mapping, current-token callback and entity-property delegation are adapted from the PyLoxone integration maintained by JoDehli and its contributors, specifically the sealed `media_player.py`, `audio.py` and `coordinator.py` call graph. Those inspected source files contain no additional per-file copyright notices to remove or replace. This draft does not assign invented upstream copyright ownership.
|
|
6
|
+
|
|
7
|
+
The original native protocol source retains this attribution, which must accompany any future adaptation of its event mapping:
|
|
8
|
+
|
|
9
|
+
> Event names adapted from SebastianEitzert's Apache-2.0 POC in #523, comment 6251138699. See tests/fixtures/audioserver/README.md for provenance.
|
|
10
|
+
|
|
11
|
+
The actual parser/event mapping is now extracted into `pyloxone_audio/native.py`, retaining that attribution. Native transport/authentication, metadata coordination, source policy, radio and catalogue implementations are derived from the immutable accepted source tree identified by `baseline-verification.json` and the extraction provenance receipts. Native announcement ownership and the native read-only-bridge Spotify session selection are also extracted; HA preparation, provider session storage and UI responsibilities stay with the host. Relevant upstream attribution and Apache-2.0 terms are retained; no invented copyright assignment is made.
|
|
12
|
+
|
|
13
|
+
Historical fake-facade, extraction and operational evidence remains outside release assets. The concrete package exports real native classes and source-policy functions instead. Synthetic fixture provenance is preserved under `tests/library/fixtures/audioserver/README.md` outside the wheel. The older path in the attribution quoted above is historical; the current location applies to this repository and its source archive. Development-only detailed tracing and HA failure-summary publication are excluded from both library and adapter at this cutoff.
|
|
14
|
+
|
|
15
|
+
Dave directed requirements, behaviour decisions and normal-use validation. Implementation and offline testing were AI-assisted through Hermes with OpenAI primary models; release-cutoff implementation uses gpt-6.1-sol and the independently recorded review uses an actual primary OpenAI invocation. AI assistance is provenance, not an invented human author, a transfer of upstream ownership, hardware certification or a guarantee of defect freedom. Independent review identity and limitations are recorded in release-level evidence, not claimed as a substitute for tests.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyLoxone-Audio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Native audio transport and source policies for PyLoxone
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/davehocking/PyLoxone-Audio
|
|
7
|
+
Project-URL: Repository, https://github.com/davehocking/PyLoxone-Audio
|
|
8
|
+
Project-URL: Issues, https://github.com/davehocking/PyLoxone-Audio/issues
|
|
9
|
+
Project-URL: Releases, https://github.com/davehocking/PyLoxone-Audio/releases
|
|
10
|
+
Requires-Python: >=3.14
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
License-File: NOTICE.md
|
|
14
|
+
Requires-Dist: websockets<16,>=14
|
|
15
|
+
Requires-Dist: pycryptodome>=3.20
|
|
16
|
+
Requires-Dist: aiohttp
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# PyLoxone-Audio
|
|
20
|
+
|
|
21
|
+
A Python library for extending [PyLoxone](https://github.com/JoDehli/PyLoxone) capabilities on the Loxone Audio Server.
|
|
22
|
+
|
|
23
|
+
PyLoxone-Audio is a separately maintained, testable audio library used through a companion PyLoxone adapter. Home Assistant retains **one integration, one setup and the existing room entities**.
|
|
24
|
+
|
|
25
|
+
## Version 0.1.0
|
|
26
|
+
|
|
27
|
+
The 0.1.0 scope covers Audio Server communication, now-playing metadata, playback and source-return behaviour, together with the PyLoxone adapter and tests for both.
|
|
28
|
+
|
|
29
|
+
Package availability and release-specific compatibility information belong on the [Releases page](https://github.com/davehocking/PyLoxone-Audio/releases). The library version is separate from the PyLoxone integration version; publishing a library package does not itself add support to an upstream PyLoxone release.
|
|
30
|
+
|
|
31
|
+
## Why a separate library?
|
|
32
|
+
|
|
33
|
+
Audio communication and playback behaviour are developed and tested independently of Home Assistant-specific configuration and entities. Keeping that work in a library gives it its own tests and releases, while the adapter tests cover its use within PyLoxone. PyLoxone still needs host-side review and compatibility testing when it adopts an adapter or dependency update.
|
|
34
|
+
|
|
35
|
+
PyLoxone is the main consumer, but the library remains Home Assistant-independent so other Python applications can use it.
|
|
36
|
+
|
|
37
|
+
This project complements PyLoxone; it is not a replacement for PyLoxone, Home Assistant or Loxone's own applications.
|
|
38
|
+
|
|
39
|
+
## Architecture and responsibilities
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Home Assistant
|
|
43
|
+
└─ PyLoxone: configuration, entities and Home Assistant services
|
|
44
|
+
└─ Audio adapter: translates between the integration and library
|
|
45
|
+
└─ PyLoxone-Audio: native audio communication and playback state
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**The library** handles audio communication, now-playing and source metadata, playback/source operations, source-return behaviour, and its own connection lifecycle, events and errors. It does not import Home Assistant.
|
|
49
|
+
|
|
50
|
+
**The PyLoxone adapter** connects the library to the existing integration's configuration, room/player mapping, entities, services, availability and setup/unload lifecycle. It supplies existing authenticated access rather than introducing a second user setup. Non-audio PyLoxone functionality remains the responsibility of PyLoxone.
|
|
51
|
+
|
|
52
|
+
The adapter is maintained alongside the library in this repository under `adapters/pyloxone/`. It is applied within PyLoxone, not installed as a separate Home Assistant integration. The adapter documentation identifies its supported host base and the matching library version.
|
|
53
|
+
|
|
54
|
+
The current reference adapter targets released PyLoxone **0.10.2**, exact public commit `3db77b81f69c77cc814675d191061533b464df5e`, with library **0.1.0**. The maintained `preview-build/` directory supplies a complete pinned integration ZIP, provenance/checksums, repeatable build/verification and install/update/rollback/native-UI test instructions. Its focused `adapters/pyloxone/jo-review/` pack is for upstream review; no upstream adoption is claimed.
|
|
55
|
+
|
|
56
|
+
The adapter uses the library's public interface. Ordinary internal library bug fixes should not require structural adapter changes. New capabilities or intentional breaking API changes may still need coordinated updates.
|
|
57
|
+
|
|
58
|
+
Home Assistant uses standard media-player entities and controls: **no patched Home Assistant Core or frontend, injected JavaScript/CSS, or project-specific custom card**.
|
|
59
|
+
|
|
60
|
+
## Audio behaviour
|
|
61
|
+
|
|
62
|
+
Version 0.1.0 focuses on Loxone Audio Server-backed rooms. Supported sources are **Local Library, Loxone Radio, Spotify, TuneIn and Line-In**, where available and configured in Loxone. Not every installation has every source or subscription. SoundSuit is outside the 0.1.0 scope.
|
|
63
|
+
|
|
64
|
+
Line-In appears last in the available-source list. Home Assistant's mobile source selector can require scrolling; placing Line-In last keeps the more frequently used sources easier to reach.
|
|
65
|
+
|
|
66
|
+
The main playback principles are:
|
|
67
|
+
|
|
68
|
+
- **Confirm the requested source.** A successful native command is followed by fresh now-playing feedback from the correct room identifying the requested source.
|
|
69
|
+
- **Respect the active provider.** Spotify keeps ownership of its live session and queue. Returning to a source does not always mean returning to the exact previously played track. Ordinary Spotify transfer uses Spotify Connect.
|
|
70
|
+
- **Remember useful last-good state.** Local Library returns to the remembered track where available. Failed or unconfirmed attempts do not erase the last qualified source history.
|
|
71
|
+
- **Treat position restoration as an extra.** Where applicable, make at most one bounded best-effort attempt to restore a remembered position. Exact-position proof is not required, and failure of that optional step does not turn confirmed source playback into an error.
|
|
72
|
+
- **Avoid surprise playback.** No blind retries, replay or substitute content when an operation cannot be confirmed. Superseded Home Assistant requests and integration unload are handled cleanly.
|
|
73
|
+
|
|
74
|
+
## Is Home Assistant's Spotify integration required?
|
|
75
|
+
|
|
76
|
+
**No. Spotify configured in Loxone and Home Assistant's separate Spotify integration are different things.** The library does not depend on Home Assistant, and the PyLoxone adapter does not require HA's Spotify integration to load.
|
|
77
|
+
|
|
78
|
+
- **Without HA Spotify:** native room controls, now-playing information, source selection and Loxone-backed Browse/Search remain available where configured and supported. That includes Spotify configured in Loxone. Spotify return uses the current native session or qualified remembered content where available; an empty source with no usable session/history needs a selection in Browse or Spotify Connect, not an invented replacement track. Supported native seeking and best-effort position restoration do not require HA Spotify.
|
|
79
|
+
- **With HA Spotify and an explicit room/account/device binding:** the adapter can check the authenticated Spotify user and current receiver, then ask **Loxone** to resume that account's existing Spotify session. This can use the live session rather than restarting a remembered track. **It does not seek back to a saved playback position: position remains Spotify's responsibility.** Installing HA Spotify alone does not configure that binding.
|
|
80
|
+
- **What this enhancement does not do:** it does not rebuild Spotify's queue, restore a playlist or exact position through Spotify's API, transfer playback from another receiver, or supply Spotify Browse/Search or now-playing metadata. Those are not reasons to install HA Spotify for this project.
|
|
81
|
+
- **When the optional evidence is unavailable:** missing/unloaded HA Spotify, unreadable state or no reported session do not by themselves block a valid native return, and do not produce missing-integration warnings. Positive evidence of another account/receiver is a conflict, not permission to silently fall back and take over playback. Ordinary errors and newer-request/lifecycle cancellation still apply.
|
|
82
|
+
|
|
83
|
+
See [Spotify support and the exact function/API map](https://github.com/davehocking/PyLoxone-Audio/blob/v0.1.0/SPOTIFY.md) for setup fields, active versus retained legacy methods, concrete fallback cases and test coverage.
|
|
84
|
+
|
|
85
|
+
## Repository layout
|
|
86
|
+
|
|
87
|
+
The 0.1.0 source tree separates the portable library from its Home Assistant adapter:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
pyloxone_audio/ Home Assistant-independent library
|
|
91
|
+
adapters/pyloxone/ PyLoxone adapter, host-base information and instructions
|
|
92
|
+
preview-build/ Complete pinned integration preview and tester instructions
|
|
93
|
+
tests/library/ Portable library tests
|
|
94
|
+
tests/adapter/ Audio-adapter and library/host contract tests
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This repository contains tests for this project and its adapter, not a copy of the full PyLoxone test suite. General PyLoxone connection, authentication, sensor and other non-audio tests belong to the host project and are excluded here. Broader host regression runs are separate compatibility checks, not part of this library's published test suite.
|
|
98
|
+
|
|
99
|
+
The Python package contains the portable library. The adapter stays separate from that package so installing the library does not install Home Assistant integration files.
|
|
100
|
+
|
|
101
|
+
## Installation and releases
|
|
102
|
+
|
|
103
|
+
**For Home Assistant users:** use a PyLoxone build that includes the matching audio adapter. Its manifest pins a tested library version, and Home Assistant installs that dependency automatically. The normal installation unit is PyLoxone; a separate integration or manual `pip` step is not required for a released, compatible pair. The presence of the adapter in this repository does not mean an upstream PyLoxone release already includes it.
|
|
104
|
+
|
|
105
|
+
The maintained preview targets **PyLoxone 0.10.2 with PyLoxone-Audio 0.1.0**. Before installing it, verify that the exact library version is listed on [PyPI](https://pypi.org/project/PyLoxone-Audio/0.1.0/) and check the matching [release](https://github.com/davehocking/PyLoxone-Audio/releases). A source checkout or preview ZIP alone is not proof of publication. The preview is excluded from both Python wheel and sdist, but retained in the library repository. Its provenance records offline bundle validation; public dependency availability is a separate release check. No upstream adoption or universal hardware/HAOS compatibility is claimed.
|
|
106
|
+
|
|
107
|
+
**For Python developers:** the library is packaged as a versioned wheel and source distribution, independently of the Home Assistant adapter. Use the artifacts and compatibility information for the selected release. Installing the Python library alone does not add an integration to Home Assistant.
|
|
108
|
+
|
|
109
|
+
A new library release does **not** automatically update existing PyLoxone installations. Adoption happens when a PyLoxone release selects a tested compatible version, which need *not* be the newest published version. Breaking interface changes need explicit compatibility notes and coordinated adapter updates.
|
|
110
|
+
|
|
111
|
+
## Testing and compatibility
|
|
112
|
+
|
|
113
|
+
The project has two test groups:
|
|
114
|
+
|
|
115
|
+
- **Library tests** cover metadata parsing, playback/source policy, state and timing, communication errors, delayed events, disconnects and cancellation. They run without importing Home Assistant.
|
|
116
|
+
- **Adapter tests** exercise the audio library within the owning PyLoxone/Home Assistant paths, including room mapping, native entity behaviour, setup/unload, source selection and the library/adapter contract.
|
|
117
|
+
|
|
118
|
+
Automated tests use sanitised fixtures and synthetic transports rather than controlling a household's devices. Real-device checks supplement those tests; passing offline tests is not proof of every device, firmware or audible playback outcome.
|
|
119
|
+
|
|
120
|
+
Compatibility claims apply to the Python, Home Assistant, PyLoxone and device/firmware versions actually tested. No universal device or legacy Music Server compatibility is claimed.
|
|
121
|
+
|
|
122
|
+
Detailed development tracing, private rolling captures and household-specific tooling are excluded from the library and adapter deliverables. Ordinary useful runtime warnings and errors remain.
|
|
123
|
+
|
|
124
|
+
## Contributing
|
|
125
|
+
|
|
126
|
+
Focused issues, reproducible reports and sanitised test contributions are welcome. Include relevant software/device versions and the expected versus observed behaviour. Keep library tests independent of Home Assistant and adapter tests focused on audio integration behaviour; general PyLoxone tests belong with PyLoxone.
|
|
127
|
+
|
|
128
|
+
**Do not post passwords, tokens, credentials or unredacted device exports.** Remove household-specific information from logs and fixtures before sharing them.
|
|
129
|
+
|
|
130
|
+
## Acknowledgements and licence
|
|
131
|
+
|
|
132
|
+
This independent project builds on work from [PyLoxone](https://github.com/JoDehli/PyLoxone) and its contributors. It does not imply official affiliation with Loxone or upstream approval of unreleased changes.
|
|
133
|
+
|
|
134
|
+
Thanks also to [Sebastian (@SebastianEitzert)](https://github.com/SebastianEitzert) for his contributions to this project.
|
|
135
|
+
|
|
136
|
+
Development is human-directed, with LLM assistance for drafting and implementation under supervisory review.
|
|
137
|
+
|
|
138
|
+
Licensed under the [Apache License 2.0](LICENSE), matching PyLoxone. Relevant upstream copyright, attribution and notice requirements are retained when code is reused.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyLoxone-Audio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Native audio transport and source policies for PyLoxone
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/davehocking/PyLoxone-Audio
|
|
7
|
+
Project-URL: Repository, https://github.com/davehocking/PyLoxone-Audio
|
|
8
|
+
Project-URL: Issues, https://github.com/davehocking/PyLoxone-Audio/issues
|
|
9
|
+
Project-URL: Releases, https://github.com/davehocking/PyLoxone-Audio/releases
|
|
10
|
+
Requires-Python: >=3.14
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
License-File: NOTICE.md
|
|
14
|
+
Requires-Dist: websockets<16,>=14
|
|
15
|
+
Requires-Dist: pycryptodome>=3.20
|
|
16
|
+
Requires-Dist: aiohttp
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# PyLoxone-Audio
|
|
20
|
+
|
|
21
|
+
A Python library for extending [PyLoxone](https://github.com/JoDehli/PyLoxone) capabilities on the Loxone Audio Server.
|
|
22
|
+
|
|
23
|
+
PyLoxone-Audio is a separately maintained, testable audio library used through a companion PyLoxone adapter. Home Assistant retains **one integration, one setup and the existing room entities**.
|
|
24
|
+
|
|
25
|
+
## Version 0.1.0
|
|
26
|
+
|
|
27
|
+
The 0.1.0 scope covers Audio Server communication, now-playing metadata, playback and source-return behaviour, together with the PyLoxone adapter and tests for both.
|
|
28
|
+
|
|
29
|
+
Package availability and release-specific compatibility information belong on the [Releases page](https://github.com/davehocking/PyLoxone-Audio/releases). The library version is separate from the PyLoxone integration version; publishing a library package does not itself add support to an upstream PyLoxone release.
|
|
30
|
+
|
|
31
|
+
## Why a separate library?
|
|
32
|
+
|
|
33
|
+
Audio communication and playback behaviour are developed and tested independently of Home Assistant-specific configuration and entities. Keeping that work in a library gives it its own tests and releases, while the adapter tests cover its use within PyLoxone. PyLoxone still needs host-side review and compatibility testing when it adopts an adapter or dependency update.
|
|
34
|
+
|
|
35
|
+
PyLoxone is the main consumer, but the library remains Home Assistant-independent so other Python applications can use it.
|
|
36
|
+
|
|
37
|
+
This project complements PyLoxone; it is not a replacement for PyLoxone, Home Assistant or Loxone's own applications.
|
|
38
|
+
|
|
39
|
+
## Architecture and responsibilities
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Home Assistant
|
|
43
|
+
└─ PyLoxone: configuration, entities and Home Assistant services
|
|
44
|
+
└─ Audio adapter: translates between the integration and library
|
|
45
|
+
└─ PyLoxone-Audio: native audio communication and playback state
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**The library** handles audio communication, now-playing and source metadata, playback/source operations, source-return behaviour, and its own connection lifecycle, events and errors. It does not import Home Assistant.
|
|
49
|
+
|
|
50
|
+
**The PyLoxone adapter** connects the library to the existing integration's configuration, room/player mapping, entities, services, availability and setup/unload lifecycle. It supplies existing authenticated access rather than introducing a second user setup. Non-audio PyLoxone functionality remains the responsibility of PyLoxone.
|
|
51
|
+
|
|
52
|
+
The adapter is maintained alongside the library in this repository under `adapters/pyloxone/`. It is applied within PyLoxone, not installed as a separate Home Assistant integration. The adapter documentation identifies its supported host base and the matching library version.
|
|
53
|
+
|
|
54
|
+
The current reference adapter targets released PyLoxone **0.10.2**, exact public commit `3db77b81f69c77cc814675d191061533b464df5e`, with library **0.1.0**. The maintained `preview-build/` directory supplies a complete pinned integration ZIP, provenance/checksums, repeatable build/verification and install/update/rollback/native-UI test instructions. Its focused `adapters/pyloxone/jo-review/` pack is for upstream review; no upstream adoption is claimed.
|
|
55
|
+
|
|
56
|
+
The adapter uses the library's public interface. Ordinary internal library bug fixes should not require structural adapter changes. New capabilities or intentional breaking API changes may still need coordinated updates.
|
|
57
|
+
|
|
58
|
+
Home Assistant uses standard media-player entities and controls: **no patched Home Assistant Core or frontend, injected JavaScript/CSS, or project-specific custom card**.
|
|
59
|
+
|
|
60
|
+
## Audio behaviour
|
|
61
|
+
|
|
62
|
+
Version 0.1.0 focuses on Loxone Audio Server-backed rooms. Supported sources are **Local Library, Loxone Radio, Spotify, TuneIn and Line-In**, where available and configured in Loxone. Not every installation has every source or subscription. SoundSuit is outside the 0.1.0 scope.
|
|
63
|
+
|
|
64
|
+
Line-In appears last in the available-source list. Home Assistant's mobile source selector can require scrolling; placing Line-In last keeps the more frequently used sources easier to reach.
|
|
65
|
+
|
|
66
|
+
The main playback principles are:
|
|
67
|
+
|
|
68
|
+
- **Confirm the requested source.** A successful native command is followed by fresh now-playing feedback from the correct room identifying the requested source.
|
|
69
|
+
- **Respect the active provider.** Spotify keeps ownership of its live session and queue. Returning to a source does not always mean returning to the exact previously played track. Ordinary Spotify transfer uses Spotify Connect.
|
|
70
|
+
- **Remember useful last-good state.** Local Library returns to the remembered track where available. Failed or unconfirmed attempts do not erase the last qualified source history.
|
|
71
|
+
- **Treat position restoration as an extra.** Where applicable, make at most one bounded best-effort attempt to restore a remembered position. Exact-position proof is not required, and failure of that optional step does not turn confirmed source playback into an error.
|
|
72
|
+
- **Avoid surprise playback.** No blind retries, replay or substitute content when an operation cannot be confirmed. Superseded Home Assistant requests and integration unload are handled cleanly.
|
|
73
|
+
|
|
74
|
+
## Is Home Assistant's Spotify integration required?
|
|
75
|
+
|
|
76
|
+
**No. Spotify configured in Loxone and Home Assistant's separate Spotify integration are different things.** The library does not depend on Home Assistant, and the PyLoxone adapter does not require HA's Spotify integration to load.
|
|
77
|
+
|
|
78
|
+
- **Without HA Spotify:** native room controls, now-playing information, source selection and Loxone-backed Browse/Search remain available where configured and supported. That includes Spotify configured in Loxone. Spotify return uses the current native session or qualified remembered content where available; an empty source with no usable session/history needs a selection in Browse or Spotify Connect, not an invented replacement track. Supported native seeking and best-effort position restoration do not require HA Spotify.
|
|
79
|
+
- **With HA Spotify and an explicit room/account/device binding:** the adapter can check the authenticated Spotify user and current receiver, then ask **Loxone** to resume that account's existing Spotify session. This can use the live session rather than restarting a remembered track. **It does not seek back to a saved playback position: position remains Spotify's responsibility.** Installing HA Spotify alone does not configure that binding.
|
|
80
|
+
- **What this enhancement does not do:** it does not rebuild Spotify's queue, restore a playlist or exact position through Spotify's API, transfer playback from another receiver, or supply Spotify Browse/Search or now-playing metadata. Those are not reasons to install HA Spotify for this project.
|
|
81
|
+
- **When the optional evidence is unavailable:** missing/unloaded HA Spotify, unreadable state or no reported session do not by themselves block a valid native return, and do not produce missing-integration warnings. Positive evidence of another account/receiver is a conflict, not permission to silently fall back and take over playback. Ordinary errors and newer-request/lifecycle cancellation still apply.
|
|
82
|
+
|
|
83
|
+
See [Spotify support and the exact function/API map](https://github.com/davehocking/PyLoxone-Audio/blob/v0.1.0/SPOTIFY.md) for setup fields, active versus retained legacy methods, concrete fallback cases and test coverage.
|
|
84
|
+
|
|
85
|
+
## Repository layout
|
|
86
|
+
|
|
87
|
+
The 0.1.0 source tree separates the portable library from its Home Assistant adapter:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
pyloxone_audio/ Home Assistant-independent library
|
|
91
|
+
adapters/pyloxone/ PyLoxone adapter, host-base information and instructions
|
|
92
|
+
preview-build/ Complete pinned integration preview and tester instructions
|
|
93
|
+
tests/library/ Portable library tests
|
|
94
|
+
tests/adapter/ Audio-adapter and library/host contract tests
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This repository contains tests for this project and its adapter, not a copy of the full PyLoxone test suite. General PyLoxone connection, authentication, sensor and other non-audio tests belong to the host project and are excluded here. Broader host regression runs are separate compatibility checks, not part of this library's published test suite.
|
|
98
|
+
|
|
99
|
+
The Python package contains the portable library. The adapter stays separate from that package so installing the library does not install Home Assistant integration files.
|
|
100
|
+
|
|
101
|
+
## Installation and releases
|
|
102
|
+
|
|
103
|
+
**For Home Assistant users:** use a PyLoxone build that includes the matching audio adapter. Its manifest pins a tested library version, and Home Assistant installs that dependency automatically. The normal installation unit is PyLoxone; a separate integration or manual `pip` step is not required for a released, compatible pair. The presence of the adapter in this repository does not mean an upstream PyLoxone release already includes it.
|
|
104
|
+
|
|
105
|
+
The maintained preview targets **PyLoxone 0.10.2 with PyLoxone-Audio 0.1.0**. Before installing it, verify that the exact library version is listed on [PyPI](https://pypi.org/project/PyLoxone-Audio/0.1.0/) and check the matching [release](https://github.com/davehocking/PyLoxone-Audio/releases). A source checkout or preview ZIP alone is not proof of publication. The preview is excluded from both Python wheel and sdist, but retained in the library repository. Its provenance records offline bundle validation; public dependency availability is a separate release check. No upstream adoption or universal hardware/HAOS compatibility is claimed.
|
|
106
|
+
|
|
107
|
+
**For Python developers:** the library is packaged as a versioned wheel and source distribution, independently of the Home Assistant adapter. Use the artifacts and compatibility information for the selected release. Installing the Python library alone does not add an integration to Home Assistant.
|
|
108
|
+
|
|
109
|
+
A new library release does **not** automatically update existing PyLoxone installations. Adoption happens when a PyLoxone release selects a tested compatible version, which need *not* be the newest published version. Breaking interface changes need explicit compatibility notes and coordinated adapter updates.
|
|
110
|
+
|
|
111
|
+
## Testing and compatibility
|
|
112
|
+
|
|
113
|
+
The project has two test groups:
|
|
114
|
+
|
|
115
|
+
- **Library tests** cover metadata parsing, playback/source policy, state and timing, communication errors, delayed events, disconnects and cancellation. They run without importing Home Assistant.
|
|
116
|
+
- **Adapter tests** exercise the audio library within the owning PyLoxone/Home Assistant paths, including room mapping, native entity behaviour, setup/unload, source selection and the library/adapter contract.
|
|
117
|
+
|
|
118
|
+
Automated tests use sanitised fixtures and synthetic transports rather than controlling a household's devices. Real-device checks supplement those tests; passing offline tests is not proof of every device, firmware or audible playback outcome.
|
|
119
|
+
|
|
120
|
+
Compatibility claims apply to the Python, Home Assistant, PyLoxone and device/firmware versions actually tested. No universal device or legacy Music Server compatibility is claimed.
|
|
121
|
+
|
|
122
|
+
Detailed development tracing, private rolling captures and household-specific tooling are excluded from the library and adapter deliverables. Ordinary useful runtime warnings and errors remain.
|
|
123
|
+
|
|
124
|
+
## Contributing
|
|
125
|
+
|
|
126
|
+
Focused issues, reproducible reports and sanitised test contributions are welcome. Include relevant software/device versions and the expected versus observed behaviour. Keep library tests independent of Home Assistant and adapter tests focused on audio integration behaviour; general PyLoxone tests belong with PyLoxone.
|
|
127
|
+
|
|
128
|
+
**Do not post passwords, tokens, credentials or unredacted device exports.** Remove household-specific information from logs and fixtures before sharing them.
|
|
129
|
+
|
|
130
|
+
## Acknowledgements and licence
|
|
131
|
+
|
|
132
|
+
This independent project builds on work from [PyLoxone](https://github.com/JoDehli/PyLoxone) and its contributors. It does not imply official affiliation with Loxone or upstream approval of unreleased changes.
|
|
133
|
+
|
|
134
|
+
Thanks also to [Sebastian (@SebastianEitzert)](https://github.com/SebastianEitzert) for his contributions to this project.
|
|
135
|
+
|
|
136
|
+
Development is human-directed, with LLM assistance for drafting and implementation under supervisory review.
|
|
137
|
+
|
|
138
|
+
Licensed under the [Apache License 2.0](LICENSE), matching PyLoxone. Relevant upstream copyright, attribution and notice requirements are retained when code is reused.
|