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".
This commit is contained in:
Pierre Ståhl
2017-04-20 09:10:06 +02:00
committed by Paulus Schoutsen
parent 2e11d49af3
commit 93820d5124

View File

@@ -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):