Add fromjson filter

This commit is contained in:
thomas committed 2020-01-16 12:36:18 +01:00
1 parent 38fd8b779f
commit 14fd723176
2 files changed
+18 -1

No files matched your search

+6 -1
View File
@@ -12,8 +12,13 @@ from homeassistant.exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name__)
def fromjson(value):
return json.loads(value)
jinja = jinja2.Environment(loader=jinja2.FileSystemLoader("/"))
jinja.filters['fromjson'] = fromjson
llgen_config = {}
def load_yaml(fname, args={}):
@@ -89,4 +94,4 @@ def compose_node(self, parent, index):
self.ascend_resolver()
return node
yaml.composer.Composer.compose_node = compose_node
yaml.composer.Composer.compose_node = compose_node