mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
.
This commit is contained in:
@@ -21,6 +21,7 @@ def calculate_dim_values(sleepTracking, sleepTrackingZones, sleepBrightness, scr
|
||||
elif isinstance(sleepBrightness, list):
|
||||
logging.error("list style config for sleepBrightness no longer supported")
|
||||
elif sleepBrightness.startswith("ha:"):
|
||||
time.sleep(1)
|
||||
dimmode = int(float(libs.home_assistant.get_template(sleepBrightness)[3:]))
|
||||
involved_entities.extend(libs.home_assistant.get_template_listener_entities(sleepBrightness))
|
||||
elif libs.home_assistant.is_existent(sleepBrightness):
|
||||
@@ -33,6 +34,7 @@ def calculate_dim_values(sleepTracking, sleepTrackingZones, sleepBrightness, scr
|
||||
elif isinstance(screenBrightness, list):
|
||||
logging.error("list style config for screenBrightness no longer supported")
|
||||
elif screenBrightness.startswith("ha:"):
|
||||
time.sleep(1)
|
||||
dimValueNormal = int(float(libs.home_assistant.get_template(screenBrightness)[3:]))
|
||||
involved_entities.extend(libs.home_assistant.get_template_listener_entities(screenBrightness))
|
||||
elif libs.home_assistant.is_existent(screenBrightness):
|
||||
|
||||
@@ -246,6 +246,8 @@ def execute_script(entity_name: str, domain: str, service: str, service_data: di
|
||||
return {}
|
||||
|
||||
def cache_template(template):
|
||||
if not template:
|
||||
raise Exception("Invalid template")
|
||||
global next_id, response_buffer
|
||||
try:
|
||||
call_id = next_id
|
||||
|
||||
@@ -76,8 +76,10 @@ class LovelaceUIPanel:
|
||||
ha_control.wait_for_ha_cache()
|
||||
|
||||
#request templates on cards
|
||||
libs.home_assistant.cache_template(self.settings.get("sleepBrightness"))
|
||||
libs.home_assistant.cache_template(self.settings.get("screenBrightness"))
|
||||
if self.settings.get("sleepBrightness").startswith("ha:"):
|
||||
libs.home_assistant.cache_template(self.settings.get("sleepBrightness"))
|
||||
if 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"):
|
||||
if c.qrcode.startswith("ha:"):
|
||||
|
||||
Reference in New Issue
Block a user