python-linkplay 0.2.4__tar.gz → 0.2.6__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.4/src/python_linkplay.egg-info → python_linkplay-0.2.6}/PKG-INFO +7 -5
  2. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/README.md +6 -4
  3. python_linkplay-0.2.6/src/linkplay/__version__.py +1 -0
  4. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/bridge.py +9 -3
  5. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/consts.py +11 -9
  6. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/discovery.py +0 -1
  7. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/exceptions.py +3 -1
  8. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/manufacturers.py +8 -0
  9. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/utils.py +1 -1
  10. {python_linkplay-0.2.4 → python_linkplay-0.2.6/src/python_linkplay.egg-info}/PKG-INFO +7 -5
  11. python_linkplay-0.2.4/src/linkplay/__version__.py +0 -1
  12. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/LICENSE +0 -0
  13. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/pyproject.toml +0 -0
  14. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/setup.cfg +0 -0
  15. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/setup.py +0 -0
  16. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/__init__.py +0 -0
  17. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/__main__.py +0 -0
  18. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/controller.py +0 -0
  19. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/linkplay/endpoint.py +0 -0
  20. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/python_linkplay.egg-info/SOURCES.txt +0 -0
  21. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/python_linkplay.egg-info/dependency_links.txt +0 -0
  22. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/python_linkplay.egg-info/not-zip-safe +0 -0
  23. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/src/python_linkplay.egg-info/requires.txt +0 -0
  24. {python_linkplay-0.2.4 → python_linkplay-0.2.6}/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.4
3
+ Version: 0.2.6
4
4
  Summary: A Python Library for Seamless LinkPlay Device Control
5
5
  Author: Velleman Group nv
6
6
  License: MIT
@@ -48,16 +48,18 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
48
48
  4. Metadata Retrieval: Retrieve essential metadata such as track information, artist details, and album data, enabling you to enhance the user interface and display relevant information in your applications.
49
49
 
50
50
  ## LinkPlay API documentation
51
-
52
- - https://github.com/n4archive/LinkPlayAPI
53
- - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
54
- - https://github.com/ramikg/linkplay-cli
55
51
  - https://developer.arylic.com/httpapi/
56
52
  - http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
57
53
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
58
54
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
55
+
56
+ ## LinkPlay references
57
+ - https://github.com/n4archive/LinkPlayAPI
58
+ - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
59
+ - https://github.com/ramikg/linkplay-cli
59
60
  - https://github.com/DanBrezeanu/wiim-extended-http-api
60
61
  - https://github.com/cvdlinden/wiim-httpapi
62
+ - https://community.openhab.org/t/linkplay-binding/161995
61
63
 
62
64
  ## Multiroom
63
65
 
@@ -20,16 +20,18 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
20
20
  4. Metadata Retrieval: Retrieve essential metadata such as track information, artist details, and album data, enabling you to enhance the user interface and display relevant information in your applications.
21
21
 
22
22
  ## LinkPlay API documentation
23
-
24
- - https://github.com/n4archive/LinkPlayAPI
25
- - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
26
- - https://github.com/ramikg/linkplay-cli
27
23
  - https://developer.arylic.com/httpapi/
28
24
  - http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
29
25
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
30
26
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
27
+
28
+ ## LinkPlay references
29
+ - https://github.com/n4archive/LinkPlayAPI
30
+ - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
31
+ - https://github.com/ramikg/linkplay-cli
31
32
  - https://github.com/DanBrezeanu/wiim-extended-http-api
32
33
  - https://github.com/cvdlinden/wiim-httpapi
34
+ - https://community.openhab.org/t/linkplay-binding/161995
33
35
 
34
36
  ## Multiroom
35
37
 
@@ -0,0 +1 @@
1
+ __version__ = '0.2.6'
@@ -153,9 +153,15 @@ class LinkPlayPlayer:
153
153
 
154
154
  self.properties = fixup_player_properties(properties)
155
155
  if self.bridge.device.manufacturer == MANUFACTURER_WIIM:
156
- self.metainfo: dict[
157
- MetaInfo, dict[MetaInfoMetaData, str]
158
- ] = await self.bridge.json_request(LinkPlayCommand.META_INFO) # type: ignore[assignment]
156
+ try:
157
+ self.metainfo: dict[
158
+ MetaInfo, dict[MetaInfoMetaData, str]
159
+ ] = await self.bridge.json_request(LinkPlayCommand.META_INFO) # type: ignore[assignment]
160
+ except LinkPlayInvalidDataException as exc:
161
+ if getattr(exc, "data", None) == "Failed":
162
+ self.metainfo = {}
163
+ else:
164
+ raise
159
165
  else:
160
166
  self.metainfo = {}
161
167
 
@@ -473,18 +473,18 @@ class MultiroomAttribute(StrEnum):
473
473
 
474
474
  def __repr__(self):
475
475
  return self.value
476
-
477
476
 
478
- class MetaInfo(StrEnum):
479
477
 
478
+ class MetaInfo(StrEnum):
480
479
  METADATA = "metaData"
481
-
480
+
482
481
  def __str__(self):
483
482
  return self.value
484
483
 
485
484
  def __repr__(self):
486
- return self.value
487
-
485
+ return self.value
486
+
487
+
488
488
  class MetaInfoMetaData(StrEnum):
489
489
  """Defines the metadata within the metainfo."""
490
490
 
@@ -496,25 +496,27 @@ class MetaInfoMetaData(StrEnum):
496
496
  BIT_DEPTH = "bitDepth"
497
497
  BIT_RATE = "bitRate"
498
498
  TRACK_ID = "trackId"
499
-
499
+
500
500
  def __str__(self):
501
501
  return self.value
502
502
 
503
503
  def __repr__(self):
504
- return self.value
505
-
504
+ return self.value
505
+
506
506
 
507
507
  class AudioOutputHwMode(StrEnum):
508
508
  """Defines a output mode for the hardware."""
509
+
509
510
  OPTICAL = "1"
510
511
  LINE_OUT = "2"
511
512
  COAXIAL = "3"
512
513
  HEADPHONES = "4"
513
514
 
515
+
514
516
  # Map between a play mode and how to activate the play mode
515
517
  AUDIO_OUTPUT_HW_MODE_MAP: dict[AudioOutputHwMode, str] = { # case sensitive!
516
518
  AudioOutputHwMode.OPTICAL: "optical",
517
519
  AudioOutputHwMode.LINE_OUT: "line-out",
518
520
  AudioOutputHwMode.COAXIAL: "co-axial",
519
521
  AudioOutputHwMode.HEADPHONES: "headphones",
520
- }
522
+ }
@@ -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
 
@@ -7,4 +7,6 @@ class LinkPlayRequestException(LinkPlayException):
7
7
 
8
8
 
9
9
  class LinkPlayInvalidDataException(LinkPlayException):
10
- pass
10
+ def __init__(self, message: str = "Invalid data received", data: str | None = None):
11
+ super().__init__(message)
12
+ self.data = data
@@ -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))
@@ -82,7 +82,7 @@ async def session_call_api_json(
82
82
  except json.JSONDecodeError as jsonexc:
83
83
  url = API_ENDPOINT.format(endpoint, command)
84
84
  raise LinkPlayInvalidDataException(
85
- f"Unexpected JSON ({result}) received from '{url}'"
85
+ message=f"Unexpected JSON ({result}) received from '{url}'", data=result
86
86
  ) from jsonexc
87
87
 
88
88
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python_linkplay
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: A Python Library for Seamless LinkPlay Device Control
5
5
  Author: Velleman Group nv
6
6
  License: MIT
@@ -48,16 +48,18 @@ Welcome to python-linkplay, a powerful and user-friendly Python library designed
48
48
  4. Metadata Retrieval: Retrieve essential metadata such as track information, artist details, and album data, enabling you to enhance the user interface and display relevant information in your applications.
49
49
 
50
50
  ## LinkPlay API documentation
51
-
52
- - https://github.com/n4archive/LinkPlayAPI
53
- - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
54
- - https://github.com/ramikg/linkplay-cli
55
51
  - https://developer.arylic.com/httpapi/
56
52
  - http://airscope-audio.net/core2/pdf/airscope-module-http.pdf
57
53
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Mini.pdf
58
54
  - https://www.wiimhome.com/pdf/HTTP%20API%20for%20WiiM%20Products.pdf
55
+
56
+ ## LinkPlay references
57
+ - https://github.com/n4archive/LinkPlayAPI
58
+ - https://github.com/nagyrobi/home-assistant-custom-components-linkplay
59
+ - https://github.com/ramikg/linkplay-cli
59
60
  - https://github.com/DanBrezeanu/wiim-extended-http-api
60
61
  - https://github.com/cvdlinden/wiim-httpapi
62
+ - https://community.openhab.org/t/linkplay-binding/161995
61
63
 
62
64
  ## Multiroom
63
65
 
@@ -1 +0,0 @@
1
- __version__ = '0.2.4'
File without changes