mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-23 13:02:14 +01:00
added state change callback
This commit is contained in:
@@ -62,7 +62,17 @@ class PageNode(object):
|
||||
items.append(i.data)
|
||||
return items
|
||||
|
||||
|
||||
def get_all_items_recursive(self):
|
||||
items = []
|
||||
for i in self.childs:
|
||||
if len(i.childs) > 0:
|
||||
items.extend(i.get_all_items_recursive())
|
||||
else:
|
||||
if type(i.data) is dict:
|
||||
items.append(i.data.get("item", next(iter(i.data))))
|
||||
else:
|
||||
items.append(i.data)
|
||||
return items
|
||||
|
||||
class LuiBackendConfig(object):
|
||||
|
||||
@@ -122,9 +132,3 @@ class LuiBackendConfig(object):
|
||||
def get_root_page(self):
|
||||
return self._page_config
|
||||
|
||||
def get_child_by_heading(self, heading):
|
||||
for page in self._current_page.childs:
|
||||
if heading == page.data["heading"]:
|
||||
self._current_page = page
|
||||
return self._current_page
|
||||
|
||||
|
||||
Reference in New Issue
Block a user