Fix androidtv media_image_hash (#54188)

pull/54195/head
Robert Hillis 2021-08-07 01:18:08 -04:00 committed by GitHub
parent 8b8f3b55b6
commit 0b52e13eb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -449,6 +449,11 @@ class ADBDevice(MediaPlayerEntity):
ATTR_HDMI_INPUT: None,
}
@property
def media_image_hash(self):
"""Hash value for media image."""
return f"{datetime.now().timestamp()}" if self._screencap else None
@adb_decorator()
async def _adb_screencap(self):
"""Take a screen capture from the device."""
@ -458,9 +463,6 @@ class ADBDevice(MediaPlayerEntity):
"""Fetch current playing image."""
if not self._screencap or self.state in (STATE_OFF, None) or not self.available:
return None, None
self._attr_media_image_hash = (
f"{datetime.now().timestamp()}" if self._screencap else None
)
media_data = await self._adb_screencap()
if media_data: