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
This commit is contained in:
A C++ MaNong 2020-08-05 02:01:12 -07:00 committed by GitHub
parent 7b728b17f7
commit 5b234b80e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,6 +162,7 @@ class LgWebOSMediaPlayerEntity(MediaPlayerEntity):
def update_sources(self): def update_sources(self):
"""Update list of sources from current source, apps, inputs and configured list.""" """Update list of sources from current source, apps, inputs and configured list."""
source_list = self._source_list
self._source_list = {} self._source_list = {}
conf_sources = self._customize[CONF_SOURCES] conf_sources = self._customize[CONF_SOURCES]
@ -206,6 +207,8 @@ class LgWebOSMediaPlayerEntity(MediaPlayerEntity):
or any(word in app["id"] for word in conf_sources) or any(word in app["id"] for word in conf_sources)
): ):
self._source_list["Live TV"] = app 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) @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
async def async_update(self): async def async_update(self):