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