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

@@ -52,6 +52,8 @@ class HAEntity(panel_cards.Entity):
self.state = data.get("state")
self.attributes = data.get("attributes", [])
else:
self.state = "not found"
self.attributes = []
return "~text~iid.404~X~6666~not found~"
# HA Entities
@@ -304,8 +306,6 @@ class QRCard(HACard):
super().__init__(locale, config, panel)
self.qrcode = config.get("qrCode", "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
def render(self):
# TODO: Render QRCode as HomeAssistant Template
#qrcode = apis.ha_api.render_template(qrcode)
if self.qrcode.startswith("ha:"):
self.qrcode = libs.home_assistant.get_template(self.qrcode)[3:]
result = f"{self.title}~{self.gen_nav()}~{self.qrcode}"
@@ -475,6 +475,8 @@ class AlarmCard(HACard):
main_entity = self.entities[0]
main_entity.render()
print(main_entity.state)
icon = get_icon_char("shield-off")
color = rgb_dec565([255,255,255])
supported_modes = []