This commit is contained in:
joBr99
2022-03-25 22:34:31 +01:00
parent 2806c5f706
commit a80c61f8a0
2 changed files with 4 additions and 3 deletions

View File

@@ -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"):

View File

@@ -224,12 +224,13 @@ 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
if send_page_type:
self.page_type(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")