From 93820d5124cb043e2f4373735f7c94ba48e689cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20St=C3=A5hl?= Date: Thu, 20 Apr 2017 09:10:06 +0200 Subject: [PATCH] Do not request artwork if not available (#7189) This should fix the "dancing media player" issue where the media player requests artwork when it's not really available, making the UI "dance". --- homeassistant/components/media_player/apple_tv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/media_player/apple_tv.py b/homeassistant/components/media_player/apple_tv.py index 3833d3f50bd..580870cf375 100644 --- a/homeassistant/components/media_player/apple_tv.py +++ b/homeassistant/components/media_player/apple_tv.py @@ -145,6 +145,8 @@ class AppleTvDevice(MediaPlayerDevice): @callback def playstatus_update(self, updater, playing): """Print what is currently playing when it changes.""" + self._playing = playing + if self.state == STATE_IDLE: self._artwork_hash = None elif self._has_playing_media_changed(playing): @@ -153,7 +155,6 @@ class AppleTvDevice(MediaPlayerDevice): self._artwork_hash = hashlib.md5( base.encode('utf-8')).hexdigest() - self._playing = playing self.hass.async_add_job(self.async_update_ha_state()) def _has_playing_media_changed(self, new_playing):