python-linkplay 0.0.9__tar.gz → 0.0.11__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.0.9/src/python_linkplay.egg-info → python_linkplay-0.0.11}/PKG-INFO +2 -2
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/README.md +2 -2
- python_linkplay-0.0.11/src/linkplay/__version__.py +1 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/bridge.py +20 -6
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/consts.py +18 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/controller.py +8 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/endpoint.py +12 -1
- {python_linkplay-0.0.9 → python_linkplay-0.0.11/src/python_linkplay.egg-info}/PKG-INFO +2 -2
- python_linkplay-0.0.9/src/linkplay/__version__.py +0 -1
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/LICENSE +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/pyproject.toml +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/setup.cfg +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/setup.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/__init__.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/__main__.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/discovery.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/exceptions.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/linkplay/utils.py +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/SOURCES.txt +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/not-zip-safe +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/requires.txt +0 -0
- {python_linkplay-0.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: python_linkplay
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.11
|
4
4
|
Summary: A Python Library for Seamless LinkPlay Device Control
|
5
5
|
Author: Velleman Group nv
|
6
6
|
License: MIT
|
@@ -34,7 +34,7 @@ A Python Library for Seamless LinkPlay Device Control
|
|
34
34
|
|
35
35
|
## Intro
|
36
36
|
|
37
|
-
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-
|
37
|
+
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-linkplay, you can harness this capability and seamlessly manage your LinkPlay devices from within your Python applications.
|
38
38
|
|
39
39
|
## Key features
|
40
40
|
|
@@ -7,7 +7,7 @@ A Python Library for Seamless LinkPlay Device Control
|
|
7
7
|
|
8
8
|
## Intro
|
9
9
|
|
10
|
-
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-
|
10
|
+
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-linkplay, you can harness this capability and seamlessly manage your LinkPlay devices from within your Python applications.
|
11
11
|
|
12
12
|
## Key features
|
13
13
|
|
@@ -30,4 +30,4 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
|
|
30
30
|
|
31
31
|
## Multiroom
|
32
32
|
|
33
|
-

|
33
|
+

|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.0.11'
|
@@ -26,12 +26,15 @@ class LinkPlayDevice:
|
|
26
26
|
"""Represents a LinkPlay device."""
|
27
27
|
|
28
28
|
bridge: LinkPlayBridge
|
29
|
-
properties: dict[DeviceAttribute, str]
|
30
|
-
DeviceAttribute.__members__.values(), ""
|
31
|
-
)
|
29
|
+
properties: dict[DeviceAttribute, str]
|
32
30
|
|
33
31
|
def __init__(self, bridge: LinkPlayBridge):
|
34
32
|
self.bridge = bridge
|
33
|
+
self.properties = dict.fromkeys(DeviceAttribute.__members__.values(), "")
|
34
|
+
|
35
|
+
def to_dict(self):
|
36
|
+
"""Return the state of the LinkPlayDevice."""
|
37
|
+
return {"properties": self.properties}
|
35
38
|
|
36
39
|
async def update_status(self) -> None:
|
37
40
|
"""Update the device status."""
|
@@ -74,12 +77,15 @@ class LinkPlayPlayer:
|
|
74
77
|
"""Represents a LinkPlay player."""
|
75
78
|
|
76
79
|
bridge: LinkPlayBridge
|
77
|
-
properties: dict[PlayerAttribute, str]
|
78
|
-
PlayerAttribute.__members__.values(), ""
|
79
|
-
)
|
80
|
+
properties: dict[PlayerAttribute, str]
|
80
81
|
|
81
82
|
def __init__(self, bridge: LinkPlayBridge):
|
82
83
|
self.bridge = bridge
|
84
|
+
self.properties = dict.fromkeys(PlayerAttribute.__members__.values(), "")
|
85
|
+
|
86
|
+
def to_dict(self):
|
87
|
+
"""Return the state of the LinkPlayPlayer."""
|
88
|
+
return {"properties": self.properties}
|
83
89
|
|
84
90
|
async def update_status(self) -> None:
|
85
91
|
"""Update the player status."""
|
@@ -256,6 +262,14 @@ class LinkPlayBridge:
|
|
256
262
|
|
257
263
|
return self.device.name
|
258
264
|
|
265
|
+
def to_dict(self):
|
266
|
+
"""Return the state of the LinkPlayBridge."""
|
267
|
+
return {
|
268
|
+
"endpoint": self.endpoint.to_dict(),
|
269
|
+
"device": self.device.to_dict(),
|
270
|
+
"player": self.player.to_dict(),
|
271
|
+
}
|
272
|
+
|
259
273
|
async def json_request(self, command: str) -> dict[str, str]:
|
260
274
|
"""Performs a GET request on the given command and returns the result as a JSON object."""
|
261
275
|
return await self.endpoint.json_request(command)
|
@@ -304,6 +304,12 @@ class PlayerAttribute(StrEnum):
|
|
304
304
|
VOLUME = "vol"
|
305
305
|
MUTED = "mute"
|
306
306
|
|
307
|
+
def __str__(self):
|
308
|
+
return self.value
|
309
|
+
|
310
|
+
def __repr__(self):
|
311
|
+
return self.value
|
312
|
+
|
307
313
|
|
308
314
|
class DeviceAttribute(StrEnum):
|
309
315
|
"""Defines the device attributes."""
|
@@ -412,6 +418,12 @@ class DeviceAttribute(StrEnum):
|
|
412
418
|
POWER_MODE = "power_mode"
|
413
419
|
SECURITY_CAPABILITIES = "security_capabilities"
|
414
420
|
|
421
|
+
def __str__(self):
|
422
|
+
return self.value
|
423
|
+
|
424
|
+
def __repr__(self):
|
425
|
+
return self.value
|
426
|
+
|
415
427
|
|
416
428
|
class MultiroomAttribute(StrEnum):
|
417
429
|
"""Defines the player attributes."""
|
@@ -420,3 +432,9 @@ class MultiroomAttribute(StrEnum):
|
|
420
432
|
FOLLOWER_LIST = "slave_list"
|
421
433
|
UUID = "uuid"
|
422
434
|
IP = "ip"
|
435
|
+
|
436
|
+
def __str__(self):
|
437
|
+
return self.value
|
438
|
+
|
439
|
+
def __repr__(self):
|
440
|
+
return self.value
|
@@ -29,6 +29,14 @@ class LinkPlayController:
|
|
29
29
|
]
|
30
30
|
self.bridges.extend(new_bridges)
|
31
31
|
|
32
|
+
async def add_bridge(self, bridge_to_add: LinkPlayBridge) -> None:
|
33
|
+
"""Add given LinkPlay device if not already added."""
|
34
|
+
|
35
|
+
# Add bridge
|
36
|
+
current_bridges = [bridge.device.uuid for bridge in self.bridges]
|
37
|
+
if bridge_to_add.device.uuid not in current_bridges:
|
38
|
+
self.bridges.append(bridge_to_add)
|
39
|
+
|
32
40
|
async def discover_multirooms(self) -> None:
|
33
41
|
"""Attempts to discover multirooms on the local network."""
|
34
42
|
|
@@ -3,7 +3,6 @@ from abc import ABC, abstractmethod
|
|
3
3
|
|
4
4
|
from aiohttp import ClientSession
|
5
5
|
|
6
|
-
from linkplay.consts import TCPPORT
|
7
6
|
from linkplay.utils import (
|
8
7
|
call_tcpuart,
|
9
8
|
call_tcpuart_json,
|
@@ -23,6 +22,10 @@ class LinkPlayEndpoint(ABC):
|
|
23
22
|
async def json_request(self, command: str) -> dict[str, str]:
|
24
23
|
"""Performs a request on the given command and returns the result as a JSON object."""
|
25
24
|
|
25
|
+
@abstractmethod
|
26
|
+
def to_dict(self) -> dict[str, str]:
|
27
|
+
"""Return the state of the LinkPlayEndpoint"""
|
28
|
+
|
26
29
|
|
27
30
|
class LinkPlayApiEndpoint(LinkPlayEndpoint):
|
28
31
|
"""Represents a LinkPlay HTTP API endpoint."""
|
@@ -35,6 +38,10 @@ class LinkPlayApiEndpoint(LinkPlayEndpoint):
|
|
35
38
|
self._endpoint: str = f"{protocol}://{endpoint}"
|
36
39
|
self._session: ClientSession = session
|
37
40
|
|
41
|
+
def to_dict(self):
|
42
|
+
"""Return the state of the LinkPlayEndpoint"""
|
43
|
+
return {"endpoint": self._endpoint}
|
44
|
+
|
38
45
|
async def request(self, command: str) -> None:
|
39
46
|
"""Performs a GET request on the given command and verifies the result."""
|
40
47
|
await session_call_api_ok(self._endpoint, self._session, command)
|
@@ -55,6 +62,10 @@ class LinkPlayTcpUartEndpoint(LinkPlayEndpoint):
|
|
55
62
|
):
|
56
63
|
self._connection = connection
|
57
64
|
|
65
|
+
def to_dict(self):
|
66
|
+
"""Return the state of the LinkPlayEndpoint"""
|
67
|
+
return {}
|
68
|
+
|
58
69
|
async def request(self, command: str) -> None:
|
59
70
|
reader, writer = self._connection
|
60
71
|
await call_tcpuart(reader, writer, command)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: python_linkplay
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.11
|
4
4
|
Summary: A Python Library for Seamless LinkPlay Device Control
|
5
5
|
Author: Velleman Group nv
|
6
6
|
License: MIT
|
@@ -34,7 +34,7 @@ A Python Library for Seamless LinkPlay Device Control
|
|
34
34
|
|
35
35
|
## Intro
|
36
36
|
|
37
|
-
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-
|
37
|
+
Welcome to python-linkplay, a powerful and user-friendly Python library designed to simplify the integration and control of LinkPlay-enabled devices in your projects. LinkPlay technology empowers a wide range of smart audio devices, making them interconnected and easily controllable. With python-linkplay, you can harness this capability and seamlessly manage your LinkPlay devices from within your Python applications.
|
38
38
|
|
39
39
|
## Key features
|
40
40
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.0.9'
|
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.0.9 → python_linkplay-0.0.11}/src/python_linkplay.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|