Skip to content

Commit

Permalink
Fix startup error when apps list is not configured (issue #223)
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Jan 29, 2023
1 parent efb399d commit 43722ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/samsungtv_smart/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"codeowners": ["@jaruba", "@ollo69", "@screwdgeh"],
"config_flow": true,
"iot_class": "cloud_polling",
"version": "0.11.2"
"version": "0.11.3"
}
10 changes: 4 additions & 6 deletions custom_components/samsungtv_smart/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@

MAX_CONTROLLED_ENTITY = 4

MIN_TIME_BETWEEN_APP_SCANS = timedelta(seconds=60)
MIN_TIME_BETWEEN_ST_UPDATE = timedelta(seconds=5)

SUPPORT_SAMSUNGTV_SMART = (
MediaPlayerEntityFeature.PAUSE
| MediaPlayerEntityFeature.VOLUME_SET
Expand All @@ -156,6 +153,7 @@
| MediaPlayerEntityFeature.STOP
)

MIN_TIME_BETWEEN_ST_UPDATE = timedelta(seconds=5)
SCAN_INTERVAL = timedelta(seconds=15)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -615,8 +613,7 @@ def get_next_name(index):
self._source_list = st_source_list
self._default_source_used = False

@Throttle(MIN_TIME_BETWEEN_APP_SCANS)
def _gen_installed_app_list(self, **kwargs):
def _gen_installed_app_list(self):
"""Get apps installed on TV."""

if self._dump_apps:
Expand Down Expand Up @@ -1004,7 +1001,8 @@ def _get_new_media_title(self):
# regardless of the self._cloud_source value
# if the app ID is in the configured apps but is not running_app,
# means that this is not the real running app / media title
if run_app not in list(self._app_list_st.values()):
st_apps = self._app_list_st or {}
if run_app not in list(st_apps.values()):
return self._st.channel_name

media_title = self._get_source()
Expand Down

0 comments on commit 43722ef

Please sign in to comment.