From 5b234b80e89d475177cc6871b52bb3b5881a937a Mon Sep 17 00:00:00 2001 From: A C++ MaNong Date: Wed, 5 Aug 2020 02:01:12 -0700 Subject: [PATCH] Keep webostv source list when TV is off (#38250) * keep source list when TV is off * remove source_list reset as the method ends here --- homeassistant/components/webostv/media_player.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/webostv/media_player.py b/homeassistant/components/webostv/media_player.py index aa5a2a9c79d..1cbf844b289 100644 --- a/homeassistant/components/webostv/media_player.py +++ b/homeassistant/components/webostv/media_player.py @@ -162,6 +162,7 @@ class LgWebOSMediaPlayerEntity(MediaPlayerEntity): def update_sources(self): """Update list of sources from current source, apps, inputs and configured list.""" + source_list = self._source_list self._source_list = {} conf_sources = self._customize[CONF_SOURCES] @@ -206,6 +207,8 @@ class LgWebOSMediaPlayerEntity(MediaPlayerEntity): or any(word in app["id"] for word in conf_sources) ): self._source_list["Live TV"] = app + if not self._source_list and source_list: + self._source_list = source_list @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) async def async_update(self):