mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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:
parent
2e11d49af3
commit
93820d5124
@ -145,6 +145,8 @@ class AppleTvDevice(MediaPlayerDevice):
|
|||||||
@callback
|
@callback
|
||||||
def playstatus_update(self, updater, playing):
|
def playstatus_update(self, updater, playing):
|
||||||
"""Print what is currently playing when it changes."""
|
"""Print what is currently playing when it changes."""
|
||||||
|
self._playing = playing
|
||||||
|
|
||||||
if self.state == STATE_IDLE:
|
if self.state == STATE_IDLE:
|
||||||
self._artwork_hash = None
|
self._artwork_hash = None
|
||||||
elif self._has_playing_media_changed(playing):
|
elif self._has_playing_media_changed(playing):
|
||||||
@ -153,7 +155,6 @@ class AppleTvDevice(MediaPlayerDevice):
|
|||||||
self._artwork_hash = hashlib.md5(
|
self._artwork_hash = hashlib.md5(
|
||||||
base.encode('utf-8')).hexdigest()
|
base.encode('utf-8')).hexdigest()
|
||||||
|
|
||||||
self._playing = playing
|
|
||||||
self.hass.async_add_job(self.async_update_ha_state())
|
self.hass.async_add_job(self.async_update_ha_state())
|
||||||
|
|
||||||
def _has_playing_media_changed(self, new_playing):
|
def _has_playing_media_changed(self, new_playing):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user