python-linkplay 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
- linkplay/__version__.py +1 -1
- linkplay/bridge.py +12 -2
- linkplay/controller.py +17 -0
- {python_linkplay-0.1.1.dist-info → python_linkplay-0.1.3.dist-info}/METADATA +2 -2
- {python_linkplay-0.1.1.dist-info → python_linkplay-0.1.3.dist-info}/RECORD +8 -8
- {python_linkplay-0.1.1.dist-info → python_linkplay-0.1.3.dist-info}/WHEEL +1 -1
- {python_linkplay-0.1.1.dist-info → python_linkplay-0.1.3.dist-info}/LICENSE +0 -0
- {python_linkplay-0.1.1.dist-info → python_linkplay-0.1.3.dist-info}/top_level.txt +0 -0
linkplay/__version__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.1.
|
1
|
+
__version__ = '0.1.3'
|
linkplay/bridge.py
CHANGED
@@ -69,13 +69,23 @@ class LinkPlayDevice:
|
|
69
69
|
playing_modes.insert(0, PlayingMode.NETWORK) # always supported
|
70
70
|
return playing_modes
|
71
71
|
|
72
|
+
@property
|
73
|
+
def mac(self) -> str | None:
|
74
|
+
"""Returns the mac address."""
|
75
|
+
mac = self.properties.get(DeviceAttribute.ETH_MAC_ADDRESS)
|
76
|
+
if mac == "00:00:00:00:00:00" or mac is None:
|
77
|
+
mac = self.properties.get(DeviceAttribute.STA_MAC_ADDRESS)
|
78
|
+
if mac == "00:00:00:00:00:00" or mac is None:
|
79
|
+
mac = self.properties.get(DeviceAttribute.MAC_ADDRESS)
|
80
|
+
return mac
|
81
|
+
|
72
82
|
@property
|
73
83
|
def eth(self) -> str | None:
|
74
84
|
"""Returns the ethernet address."""
|
75
85
|
eth = self.properties.get(DeviceAttribute.ETH2)
|
76
|
-
if eth == "0.0.0.0" or eth is None:
|
86
|
+
if eth == "0.0.0.0" or eth == "" or eth is None:
|
77
87
|
eth = self.properties.get(DeviceAttribute.ETH0)
|
78
|
-
if eth == "0.0.0.0" or eth is None:
|
88
|
+
if eth == "0.0.0.0" or eth == "" or eth is None:
|
79
89
|
eth = self.properties.get(DeviceAttribute.APCLI0)
|
80
90
|
return eth
|
81
91
|
|
linkplay/controller.py
CHANGED
@@ -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
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
linkplay/__init__.py,sha256=y9ZehEq-KhS3cwn-PUpwVSJGfDUx7e5wf_G6guODcTk,56
|
2
2
|
linkplay/__main__.py,sha256=Wcza80QaWfOaHjyJEfQYhB9kiPLE0NOqIj4zVWv2Nqs,577
|
3
|
-
linkplay/__version__.py,sha256=
|
4
|
-
linkplay/bridge.py,sha256=
|
3
|
+
linkplay/__version__.py,sha256=uZsygMXMKRw-7qhWojAjnpm8GFPXU92xW6XA8O5GwFY,22
|
4
|
+
linkplay/bridge.py,sha256=hB6Gc8HHsCoSRRhXPgd-O-148mkj9_byMdIMmt4G7zM,15415
|
5
5
|
linkplay/consts.py,sha256=98VtgV4xOfXWr00yl1DwfmNxDI6Ul5fNPCyLp8ixggE,13535
|
6
|
-
linkplay/controller.py,sha256=
|
6
|
+
linkplay/controller.py,sha256=ZW3WbOhm1fzFwkkNTEAfZjBhJkhkd61LtfiFgWXqjE0,3903
|
7
7
|
linkplay/discovery.py,sha256=NnkO9gknp3Cyff7830zBu1LwyhkkWCdhDbEDbAwF8D8,4610
|
8
8
|
linkplay/endpoint.py,sha256=_gelW0cDWt0SC8EApwaKIVh_YJIMNiOkfrLR_RYW7aM,2677
|
9
9
|
linkplay/exceptions.py,sha256=Kow13uJPSL4y6rXMnkcl_Yp9wH1weOyKw_knd0p-Exc,173
|
10
10
|
linkplay/utils.py,sha256=Kmbzw8zC9mV89ZOC5-GNtbiLkgUkuvAEUcsJdRkSY-w,8485
|
11
|
-
python_linkplay-0.1.
|
12
|
-
python_linkplay-0.1.
|
13
|
-
python_linkplay-0.1.
|
14
|
-
python_linkplay-0.1.
|
15
|
-
python_linkplay-0.1.
|
11
|
+
python_linkplay-0.1.3.dist-info/LICENSE,sha256=bgEtxMyjEHX_4uwaAY3GCFTm234D4AOZ5dM15sk26ms,1073
|
12
|
+
python_linkplay-0.1.3.dist-info/METADATA,sha256=ngz5jCdq3EMT1_bjXqGK4UwuT5oJtxa3ONymLsLxAic,2987
|
13
|
+
python_linkplay-0.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
14
|
+
python_linkplay-0.1.3.dist-info/top_level.txt,sha256=CpSaOVPTzJf5TVIL7MrotSCR34gcIOQy-11l4zGmxxM,9
|
15
|
+
python_linkplay-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|