devialet 1.5.7__tar.gz → 1.5.9__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.7 → devialet-1.5.9}/PKG-INFO +13 -2
- {devialet-1.5.7 → devialet-1.5.9}/devialet/devialet_api.py +37 -26
- {devialet-1.5.7 → devialet-1.5.9}/devialet.egg-info/PKG-INFO +13 -2
- {devialet-1.5.7 → devialet-1.5.9}/setup.py +1 -1
- {devialet-1.5.7 → devialet-1.5.9}/LICENSE +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/README.md +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet/__init__.py +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet/const.py +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet.egg-info/SOURCES.txt +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet.egg-info/dependency_links.txt +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet.egg-info/requires.txt +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/devialet.egg-info/top_level.txt +0 -0
- {devialet-1.5.7 → devialet-1.5.9}/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.9
|
|
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,51 +562,62 @@ 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
|
-
|
|
586
|
-
|
|
587
|
-
return
|
|
588
|
-
except UpnpXmlParseError as x:
|
|
589
|
-
LOGGER.error("Error playing %s %s", media_title, x.text)
|
|
590
|
-
return False
|
|
595
|
+
if await self.async_upnp_play():
|
|
596
|
+
return True
|
|
597
|
+
# The UPnP renderer can report PLAYING while paused and then refuses Play (error 701)
|
|
598
|
+
return await self._async_post_request(UrlSuffix.PLAY)
|
|
591
599
|
|
|
592
|
-
|
|
600
|
+
LOGGER.error("Error playing %s: the device could not open %s", media_title, media_id)
|
|
601
|
+
return False
|
|
593
602
|
|
|
594
|
-
async def async_upnp_play(self) ->
|
|
603
|
+
async def async_upnp_play(self) -> bool:
|
|
595
604
|
"""Send the play command over UPnP."""
|
|
596
605
|
if not self.upnp_available:
|
|
597
606
|
LOGGER.error("No UPnP location discovered")
|
|
598
|
-
return
|
|
607
|
+
return False
|
|
599
608
|
|
|
600
609
|
service = self._upnp_device.service(AV_TRANSPORT)
|
|
601
|
-
|
|
610
|
+
play = service.action("Play")
|
|
602
611
|
|
|
603
612
|
try:
|
|
604
|
-
await
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
return
|
|
608
|
-
except UpnpXmlParseError:
|
|
609
|
-
|
|
613
|
+
await play.async_call(InstanceID=0, Speed="1")
|
|
614
|
+
except UpnpActionResponseError as a:
|
|
615
|
+
LOGGER.debug("Error sending UPnP play: %s %s", a.error_code, a.error_desc)
|
|
616
|
+
return False
|
|
617
|
+
except UpnpXmlParseError as x:
|
|
618
|
+
LOGGER.error("Error sending UPnP play: %s", x.text)
|
|
619
|
+
return False
|
|
620
|
+
return True
|
|
610
621
|
|
|
611
622
|
async def async_get_upnp_media_title(self, url: str) -> str | None:
|
|
612
623
|
"""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.9
|
|
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
|