From 444fb3ca06d400b77c111c52365e22e4d48b748d Mon Sep 17 00:00:00 2001 From: George Zhao Date: Tue, 10 Aug 2021 16:22:36 +0800 Subject: [PATCH] play_media does not wait for playback to end now --- custom_components/apple_airplayer/manifest.json | 4 ++-- custom_components/apple_airplayer/media_player.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/apple_airplayer/manifest.json b/custom_components/apple_airplayer/manifest.json index be989f9..523accc 100644 --- a/custom_components/apple_airplayer/manifest.json +++ b/custom_components/apple_airplayer/manifest.json @@ -1,11 +1,11 @@ { "domain": "apple_airplayer", "name": "Apple AirPlayer", - "version": "v0.0.4", + "version": "v0.0.6", "config_flow": true, "documentation": "https://github.com/georgezhao2010/apple_airplayer", "issue_tracker": "https://github.com/georgezhao2010/apple_airplayer/issue", - "requirements": ["pyatv==0.8.1"], + "requirements": ["pyatv==0.8.2"], "dependencies": [], "iot_class": "local_push", "codeowners": ["@georgezhao2010"] diff --git a/custom_components/apple_airplayer/media_player.py b/custom_components/apple_airplayer/media_player.py index b19c9f1..a6d1add 100644 --- a/custom_components/apple_airplayer/media_player.py +++ b/custom_components/apple_airplayer/media_player.py @@ -79,9 +79,9 @@ async def async_turn_on(self): async def async_play_media(self, media_type, media_id, **kwargs): if self._player_device.support_play_url: - await self.async_play_url(media_id) + self.hass.async_create_task(self.async_play_url(media_id)) elif self._player_device.support_stream_file: - await self.async_play_stream(media_id) + self.hass.async_create_task(self.async_play_stream(media_id)) async def async_save_audio_file(self, filename, data): def save_audio():