devialet 1.5.6__tar.gz → 1.5.8__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.
- {devialet-1.5.6 → devialet-1.5.8}/PKG-INFO +13 -2
- {devialet-1.5.6 → devialet-1.5.8}/devialet/devialet_api.py +34 -25
- {devialet-1.5.6 → devialet-1.5.8}/devialet.egg-info/PKG-INFO +13 -2
- {devialet-1.5.6 → devialet-1.5.8}/setup.py +1 -1
- {devialet-1.5.6 → devialet-1.5.8}/LICENSE +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/README.md +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet/__init__.py +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet/const.py +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet.egg-info/SOURCES.txt +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet.egg-info/dependency_links.txt +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet.egg-info/requires.txt +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/devialet.egg-info/top_level.txt +0 -0
- {devialet-1.5.6 → devialet-1.5.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: devialet
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.8
|
|
4
4
|
Summary: Devialet API
|
|
5
5
|
Home-page: https://github.com/fwestenberg/devialet
|
|
6
6
|
Download-URL: https://github.com/fwestenberg/devialet/releases/latest
|
|
@@ -21,5 +21,16 @@ Description-Content-Type: text/markdown
|
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: aiohttp
|
|
23
23
|
Requires-Dist: async_upnp_client
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: download-url
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: summary
|
|
24
35
|
|
|
25
36
|
Devialet API
|
|
@@ -562,50 +562,59 @@ class DevialetApi:
|
|
|
562
562
|
"""Play media uri over UPnP."""
|
|
563
563
|
if not self.upnp_available:
|
|
564
564
|
LOGGER.error("No UPnP location discovered")
|
|
565
|
-
return
|
|
565
|
+
return False
|
|
566
566
|
|
|
567
567
|
if default_title:
|
|
568
568
|
media_title = await self.async_get_upnp_media_title(media_id) or media_title
|
|
569
569
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
urls = [media_id]
|
|
571
|
+
# The Devialet UPnP renderer cannot open HTTPS (error 716), most radio streams also serve HTTP
|
|
572
|
+
if media_id.startswith("https://"):
|
|
573
|
+
urls.append("http://" + media_id.removeprefix("https://"))
|
|
574
|
+
|
|
575
|
+
service = self._upnp_device.service(AV_TRANSPORT)
|
|
576
|
+
set_uri = service.action("SetAVTransportURI")
|
|
577
|
+
|
|
578
|
+
for url in urls:
|
|
579
|
+
metadata = await self.dmr_device.construct_play_media_metadata(
|
|
580
|
+
media_url=url,
|
|
573
581
|
media_title=media_title,
|
|
574
582
|
default_mime_type=mime_type
|
|
575
583
|
)
|
|
576
|
-
)
|
|
577
584
|
|
|
578
|
-
|
|
579
|
-
|
|
585
|
+
try:
|
|
586
|
+
result = await set_uri.async_call(InstanceID=0, CurrentURI=url, CurrentURIMetaData=metadata)
|
|
587
|
+
except UpnpActionResponseError as a:
|
|
588
|
+
LOGGER.debug("Error setting %s as UPnP source: %s %s", url, a.error_code, a.error_desc)
|
|
589
|
+
continue
|
|
590
|
+
except UpnpXmlParseError as x:
|
|
591
|
+
LOGGER.error("Error playing %s %s", media_title, x.text)
|
|
592
|
+
return False
|
|
580
593
|
|
|
581
|
-
try:
|
|
582
|
-
result = await set_uri.async_call(InstanceID=0, CurrentURI=media_id, CurrentURIMetaData=metadata)
|
|
583
594
|
LOGGER.debug("Action result: %s", str(result))
|
|
584
|
-
|
|
585
|
-
LOGGER.error("Error playing %s: %s", media_title, a.error_desc)
|
|
586
|
-
return False
|
|
587
|
-
except UpnpXmlParseError as x:
|
|
588
|
-
LOGGER.error("Error playing %s %s", media_title, x.text)
|
|
589
|
-
return False
|
|
595
|
+
return await self.async_upnp_play()
|
|
590
596
|
|
|
591
|
-
|
|
597
|
+
LOGGER.error("Error playing %s: the device could not open %s", media_title, media_id)
|
|
598
|
+
return False
|
|
592
599
|
|
|
593
|
-
async def async_upnp_play(self) ->
|
|
600
|
+
async def async_upnp_play(self) -> bool:
|
|
594
601
|
"""Send the play command over UPnP."""
|
|
595
602
|
if not self.upnp_available:
|
|
596
603
|
LOGGER.error("No UPnP location discovered")
|
|
597
|
-
return
|
|
604
|
+
return False
|
|
598
605
|
|
|
599
606
|
service = self._upnp_device.service(AV_TRANSPORT)
|
|
600
|
-
|
|
607
|
+
play = service.action("Play")
|
|
601
608
|
|
|
602
609
|
try:
|
|
603
|
-
await
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
return
|
|
607
|
-
except UpnpXmlParseError:
|
|
608
|
-
|
|
610
|
+
await play.async_call(InstanceID=0, Speed="1")
|
|
611
|
+
except UpnpActionResponseError as a:
|
|
612
|
+
LOGGER.error("Error sending UPnP play: %s", a.error_desc)
|
|
613
|
+
return False
|
|
614
|
+
except UpnpXmlParseError as x:
|
|
615
|
+
LOGGER.error("Error sending UPnP play: %s", x.text)
|
|
616
|
+
return False
|
|
617
|
+
return True
|
|
609
618
|
|
|
610
619
|
async def async_get_upnp_media_title(self, url: str) -> str | None:
|
|
611
620
|
"""Call the media URL with the HEAD method to get ICY metadata."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: devialet
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.8
|
|
4
4
|
Summary: Devialet API
|
|
5
5
|
Home-page: https://github.com/fwestenberg/devialet
|
|
6
6
|
Download-URL: https://github.com/fwestenberg/devialet/releases/latest
|
|
@@ -21,5 +21,16 @@ Description-Content-Type: text/markdown
|
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: aiohttp
|
|
23
23
|
Requires-Dist: async_upnp_client
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: download-url
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: summary
|
|
24
35
|
|
|
25
36
|
Devialet API
|
|
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
|