mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 15:34:26 +01:00
fixes #69
This commit is contained in:
@@ -90,7 +90,7 @@ class LuiController(object):
|
|||||||
LOGGER.info(f"Current page has the following items: {self._current_page.get_items()}")
|
LOGGER.info(f"Current page has the following items: {self._current_page.get_items()}")
|
||||||
if entity in self._current_page.get_all_item_names(recursive=False):
|
if entity in self._current_page.get_all_item_names(recursive=False):
|
||||||
LOGGER.info(f"Callback Entity is on current page: {entity}")
|
LOGGER.info(f"Callback Entity is on current page: {entity}")
|
||||||
self._pages_gen.render_page(self._current_page)
|
self._pages_gen.render_page(self._current_page, send_page_type=False)
|
||||||
# send detail page update, just in case
|
# send detail page update, just in case
|
||||||
if self._current_page.data.get("type", "unknown") in ["cardGrid", "cardEntities"]:
|
if self._current_page.data.get("type", "unknown") in ["cardGrid", "cardEntities"]:
|
||||||
if entity.startswith("light"):
|
if entity.startswith("light"):
|
||||||
|
|||||||
@@ -224,13 +224,14 @@ class LuiPagesGen(object):
|
|||||||
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
command = f"entityUpd,|{item}|{heading}|{icon}|{title}|{author}|{volume}|{iconplaypause}"
|
||||||
self._send_mqtt_msg(command)
|
self._send_mqtt_msg(command)
|
||||||
|
|
||||||
def render_page(self, page):
|
def render_page(self, page, send_page_type=True):
|
||||||
LOGGER.info(page)
|
LOGGER.info(page)
|
||||||
config = page.data
|
config = page.data
|
||||||
page_type = config["type"]
|
page_type = config["type"]
|
||||||
LOGGER.info(f"Started rendering of page x with type {page_type}")
|
LOGGER.info(f"Started rendering of page x with type {page_type}")
|
||||||
# Switch to page
|
# Switch to page
|
||||||
self.page_type(page_type)
|
if send_page_type:
|
||||||
|
self.page_type(page_type)
|
||||||
if page_type in ["cardEntities", "cardGrid"]:
|
if page_type in ["cardEntities", "cardGrid"]:
|
||||||
heading = config.get("heading", "unknown")
|
heading = config.get("heading", "unknown")
|
||||||
self.generate_entities_page(heading, page.get_items())
|
self.generate_entities_page(heading, page.get_items())
|
||||||
|
|||||||
Reference in New Issue
Block a user