python-linkplay 0.2.5__tar.gz → 0.2.7__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.
Files changed (24) hide show
  1. {python_linkplay-0.2.5/src/python_linkplay.egg-info → python_linkplay-0.2.7}/PKG-INFO +1 -1
  2. python_linkplay-0.2.7/src/linkplay/__version__.py +1 -0
  3. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/bridge.py +8 -2
  4. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/consts.py +9 -0
  5. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/discovery.py +0 -1
  6. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/manufacturers.py +8 -0
  7. {python_linkplay-0.2.5 → python_linkplay-0.2.7/src/python_linkplay.egg-info}/PKG-INFO +1 -1
  8. python_linkplay-0.2.5/src/linkplay/__version__.py +0 -1
  9. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/LICENSE +0 -0
  10. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/README.md +0 -0
  11. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/pyproject.toml +0 -0
  12. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/setup.cfg +0 -0
  13. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/setup.py +0 -0
  14. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/__init__.py +0 -0
  15. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/__main__.py +0 -0
  16. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/controller.py +0 -0
  17. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/endpoint.py +0 -0
  18. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/exceptions.py +0 -0
  19. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/linkplay/utils.py +0 -0
  20. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/python_linkplay.egg-info/SOURCES.txt +0 -0
  21. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
  22. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/python_linkplay.egg-info/not-zip-safe +0 -0
  23. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/python_linkplay.egg-info/requires.txt +0 -0
  24. {python_linkplay-0.2.5 → python_linkplay-0.2.7}/src/python_linkplay.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_linkplay
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: A Python Library for Seamless LinkPlay Device Control
5
5
  Author: Velleman Group nv
6
6
  License: MIT
@@ -0,0 +1 @@
1
+ __version__ = '0.2.7'
@@ -8,6 +8,7 @@ from linkplay.consts import (
8
8
  LOGGER,
9
9
  PLAY_MODE_SEND_MAP,
10
10
  AudioOutputHwMode,
11
+ AudioOutputModeResponse,
11
12
  ChannelType,
12
13
  DeviceAttribute,
13
14
  EqualizerMode,
@@ -298,9 +299,14 @@ class LinkPlayPlayer:
298
299
  """Set the audio hardware output."""
299
300
  await self.bridge.request(LinkPlayCommand.AUDIO_OUTPUT_HW_MODE_SET.format(mode))
300
301
 
301
- async def get_audio_output_hw_mode(self) -> None:
302
+ async def get_audio_output_hw_mode(self) -> AudioOutputModeResponse:
302
303
  """Get the audio hardware output."""
303
- await self.bridge.json_request(LinkPlayCommand.AUDIO_OUTPUT_HW_MODE)
304
+ resp = await self.bridge.json_request(LinkPlayCommand.AUDIO_OUTPUT_HW_MODE)
305
+ return AudioOutputModeResponse(
306
+ AudioOutputHwMode(str(resp.get("hardware"))),
307
+ resp.get("source", "") == "1",
308
+ resp.get("audiocast", "") == "1",
309
+ )
304
310
 
305
311
  @property
306
312
  def muted(self) -> bool:
@@ -520,3 +520,12 @@ AUDIO_OUTPUT_HW_MODE_MAP: dict[AudioOutputHwMode, str] = { # case sensitive!
520
520
  AudioOutputHwMode.COAXIAL: "co-axial",
521
521
  AudioOutputHwMode.HEADPHONES: "headphones",
522
522
  }
523
+
524
+
525
+ class AudioOutputModeResponse:
526
+ """Defines a response for the audio output hardware mode."""
527
+
528
+ def __init__(self, hardware: AudioOutputHwMode, source: bool, audiocast: bool):
529
+ self.hardware = hardware
530
+ self.bluetooth_source = source
531
+ self.audiocast = audiocast
@@ -37,7 +37,6 @@ async def linkplay_factory_bridge_endpoint(
37
37
 
38
38
  bridge: LinkPlayBridge = LinkPlayBridge(endpoint=endpoint)
39
39
  await bridge.device.update_status()
40
- await bridge.player.update_status()
41
40
  return bridge
42
41
 
43
42
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  from typing import Final
4
4
 
5
+ from linkplay.consts import LOGGER
6
+
5
7
  MANUFACTURER_ARTSOUND: Final[str] = "ArtSound"
6
8
  MANUFACTURER_ARYLIC: Final[str] = "Arylic"
7
9
  MANUFACTURER_IEAST: Final[str] = "iEAST"
@@ -71,4 +73,10 @@ PROJECTID_LOOKUP: Final[dict[str, tuple[str, str]]] = {
71
73
 
72
74
  def get_info_from_project(project: str) -> tuple[str, str]:
73
75
  """Get manufacturer and model info based on given project."""
76
+ if project not in PROJECTID_LOOKUP:
77
+ LOGGER.warning(
78
+ "The device '%s' is not found in our list. To improve experience, open an issue on GitHub with the project name %s, the manufacturer and the product name.",
79
+ project,
80
+ project,
81
+ )
74
82
  return PROJECTID_LOOKUP.get(project, (MANUFACTURER_GENERIC, MODELS_GENERIC))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_linkplay
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: A Python Library for Seamless LinkPlay Device Control
5
5
  Author: Velleman Group nv
6
6
  License: MIT
@@ -1 +0,0 @@
1
- __version__ = '0.2.5'
File without changes