From 723be0735ed8cd811f242fa9335cdf52e8324635 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:29:31 +0100 Subject: [PATCH] . --- .../rootfs/usr/bin/mqtt-manager/libs/home_assistant.py | 2 +- nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/home_assistant.py b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/home_assistant.py index afd700fc..6caa5102 100644 --- a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/home_assistant.py +++ b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/libs/home_assistant.py @@ -232,7 +232,7 @@ def execute_script(entity_name: str, domain: str, service: str, service_data: di ] } send_message(json.dumps(msg)) - # busy waiting for response with a timeout of 0.2 seconds - maybe there's a better way of doing this + # busy waiting for response with a timeout of 0.4 seconds- maybe there's a better way of doing this mustend = time.time() + 0.4 while time.time() < mustend: if response_buffer[call_id] == True: diff --git a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py index 84177a35..37f33800 100644 --- a/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py +++ b/nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py @@ -76,9 +76,9 @@ class LovelaceUIPanel: ha_control.wait_for_ha_cache() #request templates on cards - if self.settings.get("sleepBrightness").startswith("ha:"): + if isinstance(self.settings.get("sleepBrightness",""), str) and self.settings.get("sleepBrightness", "").startswith("ha:"): libs.home_assistant.cache_template(self.settings.get("sleepBrightness")) - if self.settings.get("screenBrightness").startswith("ha:"): + if isinstance(self.settings.get("sleepBrightness",""), str) and self.settings.get("screenBrightness", "").startswith("ha:"): libs.home_assistant.cache_template(self.settings.get("screenBrightness")) for c in self.cards.values(): if hasattr(c, "qrcode"):