mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add timestamp to lg_netcast media_image_url to update image correctly (#30933)
* add timestamp to media_image_url to update image correctly * applying isort on source * apply black formatting on source * using f strings in media_image_url property * remove unnecessary casting
This commit is contained in:
parent
2516b9474d
commit
1d5d56faf8
@ -1,5 +1,5 @@
|
|||||||
"""Support for LG TV running on NetCast 3 or 4."""
|
"""Support for LG TV running on NetCast 3 or 4."""
|
||||||
from datetime import timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pylgnetcast import LgNetCastClient, LgNetCastError
|
from pylgnetcast import LgNetCastClient, LgNetCastError
|
||||||
@ -199,7 +199,9 @@ class LgTVDevice(MediaPlayerDevice):
|
|||||||
@property
|
@property
|
||||||
def media_image_url(self):
|
def media_image_url(self):
|
||||||
"""URL for obtaining a screen capture."""
|
"""URL for obtaining a screen capture."""
|
||||||
return self._client.url + "data?target=screen_image"
|
return (
|
||||||
|
f"{self._client.url}data?target=screen_image&_={datetime.now().timestamp()}"
|
||||||
|
)
|
||||||
|
|
||||||
def turn_off(self):
|
def turn_off(self):
|
||||||
"""Turn off media player."""
|
"""Turn off media player."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user