feat: add SmartObject and TemplateLibrary classes

This commit is contained in:
2026-04-16 19:21:47 +02:00
parent 3f916363f1
commit 923cfd4152
2 changed files with 228 additions and 0 deletions

14
templatelibrary.py Normal file
View File

@@ -0,0 +1,14 @@
import appdaemon.plugins.hass.hassapi as hass
class TemplateLibrary(hass.Hass):
def initialize(self):
self.fire_event('template_library_loaded',library_name = self.name)
def get_template_library(self):
if "templates_library" in self.args:
return self.args["templates_library"]
else:
message = f"Can't find 'templates_library'"
self.log(message,level = "ERROR", log = "main_log")
self.log(message,level = "ERROR", log = "error_log")
return None