python-linkplay 0.0.16__tar.gz → 0.0.18__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.16/src/python_linkplay.egg-info → python_linkplay-0.0.18}/PKG-INFO +1 -1
- python_linkplay-0.0.18/src/linkplay/__version__.py +1 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/bridge.py +21 -9
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/consts.py +1 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18/src/python_linkplay.egg-info}/PKG-INFO +1 -1
- python_linkplay-0.0.16/src/linkplay/__version__.py +0 -1
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/LICENSE +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/README.md +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/pyproject.toml +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/setup.cfg +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/setup.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/__init__.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/__main__.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/controller.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/discovery.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/endpoint.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/exceptions.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/linkplay/utils.py +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/SOURCES.txt +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/not-zip-safe +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/requires.txt +0 -0
- {python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.0.18'
|
@@ -62,16 +62,16 @@ class LinkPlayDevice:
|
|
62
62
|
flags = InputMode(
|
63
63
|
int(self.properties[DeviceAttribute.PLAYMODE_SUPPORT], base=16)
|
64
64
|
)
|
65
|
-
|
65
|
+
|
66
|
+
playing_modes = [INPUT_MODE_MAP[flag] for flag in flags]
|
67
|
+
playing_modes.insert(0, PlayingMode.NETWORK) # always supported
|
68
|
+
return playing_modes
|
66
69
|
|
67
70
|
@property
|
68
|
-
def eth(self) -> str:
|
71
|
+
def eth(self) -> str | None:
|
69
72
|
"""Returns the ethernet address."""
|
70
|
-
|
71
|
-
|
72
|
-
if DeviceAttribute.ETH_DHCP in self.properties
|
73
|
-
else self.properties[DeviceAttribute.ETH0]
|
74
|
-
)
|
73
|
+
eth2 = self.properties.get(DeviceAttribute.ETH2)
|
74
|
+
return eth2 if eth2 else self.properties.get(DeviceAttribute.APCLI0)
|
75
75
|
|
76
76
|
|
77
77
|
class LinkPlayPlayer:
|
@@ -163,10 +163,22 @@ class LinkPlayPlayer:
|
|
163
163
|
|
164
164
|
async def play_preset(self, preset_number: int) -> None:
|
165
165
|
"""Play a preset."""
|
166
|
-
|
167
|
-
|
166
|
+
max_number_of_presets_allowed = int(
|
167
|
+
self.bridge.device.properties.get(DeviceAttribute.PRESET_KEY) or "10"
|
168
|
+
)
|
169
|
+
if not 0 < preset_number <= max_number_of_presets_allowed:
|
170
|
+
raise ValueError(
|
171
|
+
f"Preset must be between 1 and {max_number_of_presets_allowed}."
|
172
|
+
)
|
168
173
|
await self.bridge.request(LinkPlayCommand.PLAY_PRESET.format(preset_number))
|
169
174
|
|
175
|
+
async def timesync(self) -> None:
|
176
|
+
"""Sync the time."""
|
177
|
+
import time
|
178
|
+
|
179
|
+
timestamp = time.strftime("%Y%m%d%H%M%S")
|
180
|
+
await self.bridge.request(LinkPlayCommand.TIMESYNC.format(timestamp))
|
181
|
+
|
170
182
|
@property
|
171
183
|
def muted(self) -> bool:
|
172
184
|
"""Returns if the player is muted."""
|
@@ -96,6 +96,7 @@ class LinkPlayCommand(StrEnum):
|
|
96
96
|
MULTIROOM_UNMUTE = "setPlayerCmd:slave_mute:unmute"
|
97
97
|
MULTIROOM_JOIN = "ConnectMasterAp:JoinGroupMaster:eth{}:wifi0.0.0.0"
|
98
98
|
PLAY_PRESET = "MCUKeyShortClick:{}"
|
99
|
+
TIMESYNC = "timeSync:{}"
|
99
100
|
|
100
101
|
|
101
102
|
class LinkPlayTcpUartCommand(StrEnum):
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.0.16'
|
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
|
File without changes
|
{python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{python_linkplay-0.0.16 → python_linkplay-0.0.18}/src/python_linkplay.egg-info/top_level.txt
RENAMED
File without changes
|