From eb1220015e0eda178d4db5c080540d4555897d88 Mon Sep 17 00:00:00 2001 From: ollo69 Date: Tue, 31 Jan 2023 01:25:24 +0100 Subject: [PATCH] Fix wrong running app caused by incomplete ws message --- custom_components/samsungtv_smart/api/samsungws.py | 7 ++++--- custom_components/samsungtv_smart/manifest.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/samsungtv_smart/api/samsungws.py b/custom_components/samsungtv_smart/api/samsungws.py index 9a700b4..c2239c1 100644 --- a/custom_components/samsungtv_smart/api/samsungws.py +++ b/custom_components/samsungtv_smart/api/samsungws.py @@ -623,9 +623,10 @@ def _set_running_app(self, response): return if (result := response.get("result")) is None: return - if isinstance(result, bool): - is_running = result - elif (is_running := result.get("visible")) is None: + if not isinstance(result, dict): + self._running_app = None + return + if (is_running := result.get("visible")) is None: return self._last_running_scan = datetime.utcnow() diff --git a/custom_components/samsungtv_smart/manifest.json b/custom_components/samsungtv_smart/manifest.json index 9666a16..77dbe67 100644 --- a/custom_components/samsungtv_smart/manifest.json +++ b/custom_components/samsungtv_smart/manifest.json @@ -14,5 +14,5 @@ "codeowners": ["@jaruba", "@ollo69", "@screwdgeh"], "config_flow": true, "iot_class": "cloud_polling", - "version": "0.11.3" + "version": "0.11.4b1" }