python-linkplay 0.1.0__tar.gz → 0.1.2__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.0/src/python_linkplay.egg-info → python_linkplay-0.1.2}/PKG-INFO +1 -1
- python_linkplay-0.1.2/src/linkplay/__version__.py +1 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/bridge.py +6 -12
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/controller.py +17 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/endpoint.py +6 -1
- {python_linkplay-0.1.0 → python_linkplay-0.1.2/src/python_linkplay.egg-info}/PKG-INFO +1 -1
- python_linkplay-0.1.0/src/linkplay/__version__.py +0 -1
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/LICENSE +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/README.md +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/pyproject.toml +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/setup.cfg +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/setup.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/__init__.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/__main__.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/consts.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/discovery.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/exceptions.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/linkplay/utils.py +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/SOURCES.txt +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/not-zip-safe +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/requires.txt +0 -0
- {python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.1.2'
|
@@ -72,18 +72,12 @@ class LinkPlayDevice:
|
|
72
72
|
@property
|
73
73
|
def eth(self) -> str | None:
|
74
74
|
"""Returns the ethernet address."""
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
return
|
81
|
-
eth2
|
82
|
-
if eth2
|
83
|
-
else eth0
|
84
|
-
if eth0
|
85
|
-
else self.properties.get(DeviceAttribute.APCLI0)
|
86
|
-
)
|
75
|
+
eth = self.properties.get(DeviceAttribute.ETH2)
|
76
|
+
if eth == "0.0.0.0" or eth is None:
|
77
|
+
eth = self.properties.get(DeviceAttribute.ETH0)
|
78
|
+
if eth == "0.0.0.0" or eth is None:
|
79
|
+
eth = self.properties.get(DeviceAttribute.APCLI0)
|
80
|
+
return eth
|
87
81
|
|
88
82
|
async def timesync(self) -> None:
|
89
83
|
"""Sync the time."""
|
@@ -31,6 +31,15 @@ class LinkPlayController:
|
|
31
31
|
]
|
32
32
|
self.bridges.extend(new_bridges)
|
33
33
|
|
34
|
+
async def find_bridge(self, bridge_uuid: str) -> LinkPlayBridge | None:
|
35
|
+
"""Find a LinkPlay device by its bridge uuid."""
|
36
|
+
|
37
|
+
for bridge in self.bridges:
|
38
|
+
if bridge.device.uuid == bridge_uuid:
|
39
|
+
return bridge
|
40
|
+
|
41
|
+
return None
|
42
|
+
|
34
43
|
async def add_bridge(self, bridge_to_add: LinkPlayBridge) -> None:
|
35
44
|
"""Add given LinkPlay device if not already added."""
|
36
45
|
|
@@ -39,6 +48,14 @@ class LinkPlayController:
|
|
39
48
|
if bridge_to_add.device.uuid not in current_bridges:
|
40
49
|
self.bridges.append(bridge_to_add)
|
41
50
|
|
51
|
+
async def remove_bridge(self, bridge_to_remove: LinkPlayBridge) -> None:
|
52
|
+
"""Remove given LinkPlay device if not already deleted."""
|
53
|
+
|
54
|
+
# Remove bridge
|
55
|
+
current_bridges = [bridge.device.uuid for bridge in self.bridges]
|
56
|
+
if bridge_to_remove.device.uuid in current_bridges:
|
57
|
+
self.bridges.remove(bridge_to_remove)
|
58
|
+
|
42
59
|
async def discover_multirooms(self) -> None:
|
43
60
|
"""Attempts to discover multirooms on the local network."""
|
44
61
|
|
@@ -37,7 +37,12 @@ class LinkPlayApiEndpoint(LinkPlayEndpoint):
|
|
37
37
|
"http",
|
38
38
|
"https",
|
39
39
|
], "Protocol must be either 'http' or 'https'"
|
40
|
-
|
40
|
+
include_port = (protocol == "http" and port != 80) or (
|
41
|
+
protocol == "https" and port != 443
|
42
|
+
)
|
43
|
+
port_suffix = f":{port}" if include_port else ""
|
44
|
+
self._endpoint: str = f"{protocol}://{endpoint}{port_suffix}"
|
45
|
+
|
41
46
|
self._session: ClientSession = session
|
42
47
|
|
43
48
|
def to_dict(self):
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.1.0'
|
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
|
File without changes
|
File without changes
|
{python_linkplay-0.1.0 → python_linkplay-0.1.2}/src/python_linkplay.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|