implement templtates for brightness

This commit is contained in:
joBr99
2023-12-13 16:50:28 +01:00
parent 2fb1855842
commit 4b73e20b9b
4 changed files with 19 additions and 33 deletions

View File

@@ -7,7 +7,7 @@ from scheduler import Scheduler
import scheduler.trigger as trigger
import time
import babel.dates
from ha_cards import Screensaver, EntitiesCard, card_factory, detail_open
from ha_cards import Screensaver, card_factory, detail_open
import ha_control
class LovelaceUIPanel:
@@ -76,6 +76,8 @@ 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"))
for c in self.cards.values():
if hasattr(c, "qrcode"):
if c.qrcode.startswith("ha:"):
@@ -242,12 +244,6 @@ class LovelaceUIPanel:
self.render_current_page(switchPages=True)
return
# replace iid with real entity id
#if entity_id.startswith("iid."):
# iid = entity_id.split(".")[1]
# if iid in self.entity_iids:
# entity_id = self.entity_iids[iid]
# replace iid with real entity id
if entity_id.startswith("iid."):
iid = entity_id.split(".")[1]