python-linkplay 0.1.3__tar.gz → 0.2.1__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.
- {python_linkplay-0.1.3/src/python_linkplay.egg-info → python_linkplay-0.2.1}/PKG-INFO +7 -3
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/README.md +4 -1
- python_linkplay-0.2.1/src/linkplay/__version__.py +1 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/bridge.py +111 -5
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/consts.py +30 -5
- python_linkplay-0.2.1/src/linkplay/manufacturers.py +74 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/utils.py +33 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1/src/python_linkplay.egg-info}/PKG-INFO +7 -3
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/SOURCES.txt +1 -0
- python_linkplay-0.1.3/src/linkplay/__version__.py +0 -1
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/LICENSE +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/pyproject.toml +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/setup.cfg +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/setup.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/__init__.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/__main__.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/controller.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/discovery.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/endpoint.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/linkplay/exceptions.py +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/not-zip-safe +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/requires.txt +0 -0
- {python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: python_linkplay
|
3
|
-
Version: 0.1
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: A Python Library for Seamless LinkPlay Device Control
|
5
5
|
Author: Velleman Group nv
|
6
6
|
License: MIT
|
@@ -24,12 +24,13 @@ Requires-Dist: ruff>=0.5.4; extra == "testing"
|
|
24
24
|
Requires-Dist: tox>=4.6.0; extra == "testing"
|
25
25
|
Requires-Dist: typing-extensions>=4.6.3; extra == "testing"
|
26
26
|
Requires-Dist: pre-commit>=3.8.0; extra == "testing"
|
27
|
-
|
27
|
+
Dynamic: license-file
|
28
28
|
|
29
29
|
[](https://pypi.org/project/python-linkplay/)
|
30
30
|
[](https://github.com/velleman/python-linkplay/actions/workflows/release.yaml)
|
31
31
|
|
32
32
|
# python-linkplay
|
33
|
+
|
33
34
|
A Python Library for Seamless LinkPlay Device Control
|
34
35
|
|
35
36
|
## Intro
|
@@ -54,6 +55,9 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
|
|
54
55
|
- https://developer.arylic.com/httpapi/
|
55
56
|
- http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
|
56
57
|
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
|
58
|
+
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
|
59
|
+
- https://github.com/DanBrezeanu/wiim-extended-http-api
|
60
|
+
- https://github.com/cvdlinden/wiim-httpapi
|
57
61
|
|
58
62
|
## Multiroom
|
59
63
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
1
|
[](https://pypi.org/project/python-linkplay/)
|
3
2
|
[](https://github.com/velleman/python-linkplay/actions/workflows/release.yaml)
|
4
3
|
|
5
4
|
# python-linkplay
|
5
|
+
|
6
6
|
A Python Library for Seamless LinkPlay Device Control
|
7
7
|
|
8
8
|
## Intro
|
@@ -27,6 +27,9 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
|
|
27
27
|
- https://developer.arylic.com/httpapi/
|
28
28
|
- http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
|
29
29
|
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
|
30
|
+
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
|
31
|
+
- https://github.com/DanBrezeanu/wiim-extended-http-api
|
32
|
+
- https://github.com/cvdlinden/wiim-httpapi
|
30
33
|
|
31
34
|
## Multiroom
|
32
35
|
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.2.1'
|
@@ -22,7 +22,12 @@ from linkplay.consts import (
|
|
22
22
|
)
|
23
23
|
from linkplay.endpoint import LinkPlayEndpoint
|
24
24
|
from linkplay.exceptions import LinkPlayInvalidDataException
|
25
|
-
from linkplay.
|
25
|
+
from linkplay.manufacturers import MANUFACTURER_WIIM, get_info_from_project
|
26
|
+
from linkplay.utils import (
|
27
|
+
equalizer_mode_from_number_mapping,
|
28
|
+
equalizer_mode_to_number_mapping,
|
29
|
+
fixup_player_properties,
|
30
|
+
)
|
26
31
|
|
27
32
|
|
28
33
|
class LinkPlayDevice:
|
@@ -57,6 +62,22 @@ class LinkPlayDevice:
|
|
57
62
|
"""The name of the device."""
|
58
63
|
return self.properties.get(DeviceAttribute.DEVICE_NAME, "")
|
59
64
|
|
65
|
+
@property
|
66
|
+
def manufacturer(self) -> str:
|
67
|
+
"""The manufacturer of the device."""
|
68
|
+
manufacturer, _ = get_info_from_project(
|
69
|
+
self.properties.get(DeviceAttribute.PROJECT, "")
|
70
|
+
)
|
71
|
+
return manufacturer
|
72
|
+
|
73
|
+
@property
|
74
|
+
def model(self) -> str:
|
75
|
+
"""The model of the device."""
|
76
|
+
_, model = get_info_from_project(
|
77
|
+
self.properties.get(DeviceAttribute.PROJECT, "")
|
78
|
+
)
|
79
|
+
return model
|
80
|
+
|
60
81
|
@property
|
61
82
|
def playmode_support(self) -> list[PlayingMode]:
|
62
83
|
"""Returns the player playmode support."""
|
@@ -100,10 +121,12 @@ class LinkPlayPlayer:
|
|
100
121
|
|
101
122
|
bridge: LinkPlayBridge
|
102
123
|
properties: dict[PlayerAttribute, str]
|
124
|
+
custom_properties: dict[PlayerAttribute, str]
|
103
125
|
|
104
126
|
def __init__(self, bridge: LinkPlayBridge):
|
105
127
|
self.bridge = bridge
|
106
128
|
self.properties = dict.fromkeys(PlayerAttribute.__members__.values(), "")
|
129
|
+
self.custom_properties = dict.fromkeys(PlayerAttribute.__members__.values(), "")
|
107
130
|
|
108
131
|
def to_dict(self):
|
109
132
|
"""Return the state of the LinkPlayPlayer."""
|
@@ -170,7 +193,37 @@ class LinkPlayPlayer:
|
|
170
193
|
|
171
194
|
async def set_equalizer_mode(self, mode: EqualizerMode) -> None:
|
172
195
|
"""Set the equalizer mode."""
|
173
|
-
|
196
|
+
if self.bridge.device.manufacturer == MANUFACTURER_WIIM:
|
197
|
+
await self._set_wiim_equalizer_mode(mode)
|
198
|
+
else:
|
199
|
+
await self._set_normal_equalizer_mode(mode)
|
200
|
+
|
201
|
+
async def _set_wiim_equalizer_mode(self, mode: EqualizerMode) -> None:
|
202
|
+
# WiiM devices have a different equalizer mode handling
|
203
|
+
# and don't support the general equalizer mode command
|
204
|
+
if mode not in self.available_equalizer_modes:
|
205
|
+
raise ValueError(
|
206
|
+
f"Invalid equalizer mode {mode}. Allowed equalizer modes are {self.available_equalizer_modes}."
|
207
|
+
)
|
208
|
+
|
209
|
+
if mode == EqualizerMode.NONE:
|
210
|
+
await self.bridge.json_request(LinkPlayCommand.WIIM_EQUALIZER_OFF)
|
211
|
+
else:
|
212
|
+
await self.bridge.json_request(LinkPlayCommand.WIIM_EQ_LOAD.format(mode))
|
213
|
+
# WiiM doesn't update the property after setting it
|
214
|
+
self.custom_properties[PlayerAttribute.EQUALIZER_MODE] = mode
|
215
|
+
|
216
|
+
async def _set_normal_equalizer_mode(self, mode: EqualizerMode) -> None:
|
217
|
+
"""Set the equalizer mode."""
|
218
|
+
equalizer_mode_as_number = equalizer_mode_to_number_mapping(mode)
|
219
|
+
if equalizer_mode_as_number is None:
|
220
|
+
raise ValueError(
|
221
|
+
f"Invalid equalizer mode {mode}. Allowed equalizer modes are {self.available_equalizer_modes}."
|
222
|
+
)
|
223
|
+
|
224
|
+
await self.bridge.request(
|
225
|
+
LinkPlayCommand.EQUALIZER_MODE.format(equalizer_mode_as_number)
|
226
|
+
)
|
174
227
|
|
175
228
|
async def set_loop_mode(self, mode: LoopMode) -> None:
|
176
229
|
"""Set the loop mode."""
|
@@ -260,9 +313,62 @@ class LinkPlayPlayer:
|
|
260
313
|
@property
|
261
314
|
def equalizer_mode(self) -> EqualizerMode:
|
262
315
|
"""Returns the current equalizer mode."""
|
263
|
-
|
264
|
-
self.
|
265
|
-
|
316
|
+
try:
|
317
|
+
if self.bridge.device.manufacturer == MANUFACTURER_WIIM:
|
318
|
+
# WiiM devices have a different equalizer mode handling
|
319
|
+
# and will never ever return what equalizer mode they are in
|
320
|
+
return EqualizerMode(
|
321
|
+
self.custom_properties.get(
|
322
|
+
PlayerAttribute.EQUALIZER_MODE, EqualizerMode.NONE
|
323
|
+
)
|
324
|
+
)
|
325
|
+
|
326
|
+
return EqualizerMode(
|
327
|
+
equalizer_mode_from_number_mapping(
|
328
|
+
self.properties.get(PlayerAttribute.EQUALIZER_MODE)
|
329
|
+
)
|
330
|
+
or EqualizerMode.NONE
|
331
|
+
)
|
332
|
+
except ValueError:
|
333
|
+
return EqualizerMode.NONE
|
334
|
+
|
335
|
+
@property
|
336
|
+
def available_equalizer_modes(self) -> list[EqualizerMode]:
|
337
|
+
"""Returns the available equalizer modes."""
|
338
|
+
if self.bridge.device.manufacturer == MANUFACTURER_WIIM:
|
339
|
+
return [
|
340
|
+
EqualizerMode.NONE,
|
341
|
+
EqualizerMode.FLAT,
|
342
|
+
EqualizerMode.ACOUSTIC,
|
343
|
+
EqualizerMode.BASS_BOOSTER,
|
344
|
+
EqualizerMode.BASS_REDUCER,
|
345
|
+
EqualizerMode.CLASSICAL,
|
346
|
+
EqualizerMode.DANCE,
|
347
|
+
EqualizerMode.DEEP,
|
348
|
+
EqualizerMode.ELECTRONIC,
|
349
|
+
EqualizerMode.HIP_HOP,
|
350
|
+
EqualizerMode.JAZZ,
|
351
|
+
EqualizerMode.LATIN,
|
352
|
+
EqualizerMode.LOUDNESS,
|
353
|
+
EqualizerMode.LOUNGE,
|
354
|
+
EqualizerMode.PIANO,
|
355
|
+
EqualizerMode.POP,
|
356
|
+
EqualizerMode.R_B,
|
357
|
+
EqualizerMode.ROCK,
|
358
|
+
EqualizerMode.SMALL_SPEAKERS,
|
359
|
+
EqualizerMode.SPOKEN_WORD,
|
360
|
+
EqualizerMode.TREBLE_BOOSTER,
|
361
|
+
EqualizerMode.TREBLE_REDUCER,
|
362
|
+
EqualizerMode.VOCAL_BOOSTER,
|
363
|
+
]
|
364
|
+
|
365
|
+
return [
|
366
|
+
EqualizerMode.NONE,
|
367
|
+
EqualizerMode.CLASSIC,
|
368
|
+
EqualizerMode.POP,
|
369
|
+
EqualizerMode.JAZZ,
|
370
|
+
EqualizerMode.VOCAL,
|
371
|
+
]
|
266
372
|
|
267
373
|
@property
|
268
374
|
def speaker_type(self) -> SpeakerType:
|
@@ -85,6 +85,8 @@ class LinkPlayCommand(StrEnum):
|
|
85
85
|
STOP = "setPlayerCmd:stop"
|
86
86
|
TOGGLE = "setPlayerCmd:onepause"
|
87
87
|
EQUALIZER_MODE = "setPlayerCmd:equalizer:{}"
|
88
|
+
WIIM_EQUALIZER_ON = "EQOn"
|
89
|
+
WIIM_EQUALIZER_OFF = "EQOff"
|
88
90
|
LOOP_MODE = "setPlayerCmd:loopmode:{}"
|
89
91
|
SWITCH_MODE = "setPlayerCmd:switchmode:{}"
|
90
92
|
M3U_PLAYLIST = "setPlayerCmd:m3u:play:{}"
|
@@ -97,6 +99,7 @@ class LinkPlayCommand(StrEnum):
|
|
97
99
|
MULTIROOM_JOIN = "ConnectMasterAp:JoinGroupMaster:eth{}:wifi0.0.0.0"
|
98
100
|
PLAY_PRESET = "MCUKeyShortClick:{}"
|
99
101
|
TIMESYNC = "timeSync:{}"
|
102
|
+
WIIM_EQ_LOAD = "EQLoad:{}"
|
100
103
|
|
101
104
|
|
102
105
|
class LinkPlayTcpUartCommand(StrEnum):
|
@@ -219,11 +222,33 @@ class LoopMode(StrEnum):
|
|
219
222
|
class EqualizerMode(StrEnum):
|
220
223
|
"""Defines the equalizer mode."""
|
221
224
|
|
222
|
-
NONE = "
|
223
|
-
CLASSIC = "
|
224
|
-
POP = "
|
225
|
-
JAZZ = "
|
226
|
-
VOCAL = "
|
225
|
+
NONE = "None"
|
226
|
+
CLASSIC = "Classic"
|
227
|
+
POP = "Pop"
|
228
|
+
JAZZ = "Jazz"
|
229
|
+
VOCAL = "Vocal"
|
230
|
+
|
231
|
+
# Custom equalizer modes specificly for WiiM devices
|
232
|
+
FLAT = "Flat"
|
233
|
+
ACOUSTIC = "Acoustic"
|
234
|
+
BASS_BOOSTER = "Bass Booster"
|
235
|
+
BASS_REDUCER = "Bass Reducer"
|
236
|
+
CLASSICAL = "Classical"
|
237
|
+
DANCE = "Dance"
|
238
|
+
DEEP = "Deep"
|
239
|
+
ELECTRONIC = "Electronic"
|
240
|
+
HIP_HOP = "Hip-Hop"
|
241
|
+
LATIN = "Latin"
|
242
|
+
LOUDNESS = "Loudness"
|
243
|
+
LOUNGE = "Lounge"
|
244
|
+
PIANO = "Piano"
|
245
|
+
R_B = "R&B"
|
246
|
+
ROCK = "Rock"
|
247
|
+
SMALL_SPEAKERS = "Small Speakers"
|
248
|
+
SPOKEN_WORD = "Spoken Word"
|
249
|
+
TREBLE_BOOSTER = "Treble Booster"
|
250
|
+
TREBLE_REDUCER = "Treble Reducer"
|
251
|
+
VOCAL_BOOSTER = "Vocal Booster"
|
227
252
|
|
228
253
|
|
229
254
|
class PlayingStatus(StrEnum):
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"""Manufacturers and their devices for the LinkPlay component."""
|
2
|
+
|
3
|
+
from typing import Final
|
4
|
+
|
5
|
+
MANUFACTURER_ARTSOUND: Final[str] = "ArtSound"
|
6
|
+
MANUFACTURER_ARYLIC: Final[str] = "Arylic"
|
7
|
+
MANUFACTURER_IEAST: Final[str] = "iEAST"
|
8
|
+
MANUFACTURER_WIIM: Final[str] = "WiiM"
|
9
|
+
MANUFACTURER_GGMM: Final[str] = "GGMM"
|
10
|
+
MANUFACTURER_MEDION: Final[str] = "Medion"
|
11
|
+
MANUFACTURER_GENERIC: Final[str] = "Generic"
|
12
|
+
MODELS_ARTSOUND_SMART_ZONE4: Final[str] = "Smart Zone 4 AMP"
|
13
|
+
MODELS_ARTSOUND_SMART_HYDE: Final[str] = "Smart Hyde"
|
14
|
+
MODELS_ARYLIC_S50: Final[str] = "S50+"
|
15
|
+
MODELS_ARYLIC_S50_PRO: Final[str] = "S50 Pro"
|
16
|
+
MODELS_ARYLIC_A30: Final[str] = "A30"
|
17
|
+
MODELS_ARYLIC_A50: Final[str] = "A50"
|
18
|
+
MODELS_ARYLIC_A50S: Final[str] = "A50+"
|
19
|
+
MODELS_ARYLIC_UP2STREAM_AMP: Final[str] = "Up2Stream Amp 2.0"
|
20
|
+
MODELS_ARYLIC_UP2STREAM_AMP_2P1: Final[str] = "Up2Stream Amp 2.1"
|
21
|
+
MODELS_ARYLIC_UP2STREAM_AMP_V3: Final[str] = "Up2Stream Amp v3"
|
22
|
+
MODELS_ARYLIC_UP2STREAM_AMP_V4: Final[str] = "Up2Stream Amp v4"
|
23
|
+
MODELS_ARYLIC_UP2STREAM_PRO: Final[str] = "Up2Stream Pro v1"
|
24
|
+
MODELS_ARYLIC_UP2STREAM_PRO_V3: Final[str] = "Up2Stream Pro v3"
|
25
|
+
MODELS_ARYLIC_S10P: Final[str] = "Arylic S10+"
|
26
|
+
MODELS_ARYLIC_UP2STREAM_PLATE_AMP: Final[str] = "Up2Stream Plate Amp"
|
27
|
+
MODELS_IEAST_AUDIOCAST_M5: Final[str] = "AudioCast M5"
|
28
|
+
MODELS_WIIM_AMP: Final[str] = "WiiM Amp"
|
29
|
+
MODELS_WIIM_MINI: Final[str] = "WiiM Mini"
|
30
|
+
MODELS_WIIM_PRO: Final[str] = "WiiM Pro"
|
31
|
+
MODELS_GGMM_GGMM_E2: Final[str] = "GGMM E2"
|
32
|
+
MODELS_MEDION_MD_43970: Final[str] = "Life P66970 (MD 43970)"
|
33
|
+
MODELS_GENERIC: Final[str] = "Generic"
|
34
|
+
|
35
|
+
PROJECTID_LOOKUP: Final[dict[str, tuple[str, str]]] = {
|
36
|
+
"SMART_ZONE4_AMP": (MANUFACTURER_ARTSOUND, MODELS_ARTSOUND_SMART_ZONE4),
|
37
|
+
"SMART_HYDE": (MANUFACTURER_ARTSOUND, MODELS_ARTSOUND_SMART_HYDE),
|
38
|
+
"ARYLIC_S50": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_S50),
|
39
|
+
"RP0016_S50PRO_S": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_S50_PRO),
|
40
|
+
"RP0011_WB60_S": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_A30),
|
41
|
+
"X-50": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_A50),
|
42
|
+
"ARYLIC_A50S": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_A50S),
|
43
|
+
"RP0011_WB60": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_AMP),
|
44
|
+
"UP2STREAM_AMP_V3": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_AMP_V3),
|
45
|
+
"UP2STREAM_AMP_V4": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_AMP_V4),
|
46
|
+
"UP2STREAM_PRO_V3": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_PRO_V3),
|
47
|
+
"S10P_WIFI": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_S10P),
|
48
|
+
"ARYLIC_V20": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_PLATE_AMP),
|
49
|
+
"UP2STREAM_MINI_V3": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
50
|
+
"UP2STREAM_AMP_2P1": (MANUFACTURER_ARYLIC, MODELS_ARYLIC_UP2STREAM_AMP_2P1),
|
51
|
+
"RP0014_A50C_S": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
52
|
+
"ARYLIC_A30": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
53
|
+
"ARYLIC_SUBWOOFER": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
54
|
+
"ARYLIC_S50A": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
55
|
+
"RP0010_D5_S": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
56
|
+
"RP0001": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
57
|
+
"RP0013_WA31S": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
58
|
+
"RP0010_D5": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
59
|
+
"RP0013_WA31S_S": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
60
|
+
"RP0014_A50D_S": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
61
|
+
"ARYLIC_A50TE": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
62
|
+
"ARYLIC_A50N": (MANUFACTURER_ARYLIC, MODELS_GENERIC),
|
63
|
+
"iEAST-02": (MANUFACTURER_IEAST, MODELS_IEAST_AUDIOCAST_M5),
|
64
|
+
"WiiM_Amp_4layer": (MANUFACTURER_WIIM, MODELS_WIIM_AMP),
|
65
|
+
"WiiM_Pro_with_gc4a": (MANUFACTURER_WIIM, MODELS_WIIM_PRO),
|
66
|
+
"Muzo_Mini": (MANUFACTURER_WIIM, MODELS_WIIM_MINI),
|
67
|
+
"GGMM_E2A": (MANUFACTURER_GGMM, MODELS_GGMM_GGMM_E2),
|
68
|
+
"A16": (MANUFACTURER_MEDION, MODELS_MEDION_MD_43970),
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
def get_info_from_project(project: str) -> tuple[str, str]:
|
73
|
+
"""Get manufacturer and model info based on given project."""
|
74
|
+
return PROJECTID_LOOKUP.get(project, (MANUFACTURER_GENERIC, MODELS_GENERIC))
|
@@ -19,6 +19,7 @@ from linkplay.consts import (
|
|
19
19
|
API_TIMEOUT,
|
20
20
|
MTLS_CERTIFICATE_CONTENTS,
|
21
21
|
TCP_MESSAGE_LENGTH,
|
22
|
+
EqualizerMode,
|
22
23
|
PlayerAttribute,
|
23
24
|
PlayingStatus,
|
24
25
|
)
|
@@ -241,3 +242,35 @@ def fixup_player_properties(
|
|
241
242
|
properties[PlayerAttribute.PLAYING_STATUS] = PlayingStatus.STOPPED
|
242
243
|
|
243
244
|
return properties
|
245
|
+
|
246
|
+
|
247
|
+
def equalizer_mode_to_number_mapping(equalizer_mode: EqualizerMode) -> str | None:
|
248
|
+
"""Converts EqualizerMode to a number mapping."""
|
249
|
+
match equalizer_mode:
|
250
|
+
case EqualizerMode.NONE:
|
251
|
+
return "0"
|
252
|
+
case EqualizerMode.CLASSIC:
|
253
|
+
return "1"
|
254
|
+
case EqualizerMode.POP:
|
255
|
+
return "2"
|
256
|
+
case EqualizerMode.JAZZ:
|
257
|
+
return "3"
|
258
|
+
case EqualizerMode.VOCAL:
|
259
|
+
return "4"
|
260
|
+
return None
|
261
|
+
|
262
|
+
|
263
|
+
def equalizer_mode_from_number_mapping(value: str | None) -> EqualizerMode | None:
|
264
|
+
"""Converts a number mapping to EqualizerMode."""
|
265
|
+
match value:
|
266
|
+
case "0":
|
267
|
+
return EqualizerMode.NONE
|
268
|
+
case "1":
|
269
|
+
return EqualizerMode.CLASSIC
|
270
|
+
case "2":
|
271
|
+
return EqualizerMode.POP
|
272
|
+
case "3":
|
273
|
+
return EqualizerMode.JAZZ
|
274
|
+
case "4":
|
275
|
+
return EqualizerMode.VOCAL
|
276
|
+
return None
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: python_linkplay
|
3
|
-
Version: 0.1
|
3
|
+
Version: 0.2.1
|
4
4
|
Summary: A Python Library for Seamless LinkPlay Device Control
|
5
5
|
Author: Velleman Group nv
|
6
6
|
License: MIT
|
@@ -24,12 +24,13 @@ Requires-Dist: ruff>=0.5.4; extra == "testing"
|
|
24
24
|
Requires-Dist: tox>=4.6.0; extra == "testing"
|
25
25
|
Requires-Dist: typing-extensions>=4.6.3; extra == "testing"
|
26
26
|
Requires-Dist: pre-commit>=3.8.0; extra == "testing"
|
27
|
-
|
27
|
+
Dynamic: license-file
|
28
28
|
|
29
29
|
[](https://pypi.org/project/python-linkplay/)
|
30
30
|
[](https://github.com/velleman/python-linkplay/actions/workflows/release.yaml)
|
31
31
|
|
32
32
|
# python-linkplay
|
33
|
+
|
33
34
|
A Python Library for Seamless LinkPlay Device Control
|
34
35
|
|
35
36
|
## Intro
|
@@ -54,6 +55,9 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
|
|
54
55
|
- https://developer.arylic.com/httpapi/
|
55
56
|
- http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
|
56
57
|
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
|
58
|
+
- https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
|
59
|
+
- https://github.com/DanBrezeanu/wiim-extended-http-api
|
60
|
+
- https://github.com/cvdlinden/wiim-httpapi
|
57
61
|
|
58
62
|
## Multiroom
|
59
63
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.1.3'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{python_linkplay-0.1.3 → python_linkplay-0.2.1}/src/python_linkplay.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|