diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index 76774110..8e2124c2 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -15,6 +15,7 @@ class LuiController(object): # first card (default, after startup) self._current_card = self._config.getCard(0) + self._previous_cards = [] self._pages_gen = LuiPagesGen(ha_api, config, send_mqtt_msg) @@ -145,8 +146,8 @@ class LuiController(object): if button_type == "bExit": self._pages_gen.render_card(self._current_card) if button_type == "bUp": - self._current_card = self._previous_card - self._pages_gen.render_card(self._previous_card) + self._current_card = self._previous_cards.pop() + self._pages_gen.render_card(self._current_card) if button_type == "bNext": card = self._config.getCard(self._current_card.pos+1) @@ -184,7 +185,7 @@ class LuiController(object): if button_type == "button": if entity_id.startswith('navigate'): # internal for navigation to nested pages - self._previous_card = self._current_card + self._previous_cards.append(self._current_card) self._current_card = self._config.searchCard(entity_id) self._pages_gen.render_card(self._current_card) elif entity_id.startswith('scene'): diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index ec5a4240..e979bb96 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -64,8 +64,6 @@ class LuiPagesGen(object): we_name = self._config._config_screensaver.entity.entityId unit = self._config._config_screensaver.raw_config.get("weatherUnit", "celsius") - LOGGER.info(f"test123 {we_name}") - if self._ha_api.entity_exists(we_name): we = self._ha_api.get_entity(we_name) else: @@ -167,6 +165,7 @@ class LuiPagesGen(object): min_v = entity.attributes.get("min", 0) max_v = entity.attributes.get("max", 100) return f"~number~{entityId}~{icon_id}~17299~{name}~{entity.state}|{min_v}|{max_v}" + return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~error~" def generate_entities_page(self, navigation, heading, items): command = f"entityUpd~{heading}~{navigation}" @@ -266,7 +265,7 @@ class LuiPagesGen(object): onoffbutton = 1374 else: onoffbutton = rgb_dec565([255,255,255]) - command = f"entityUpd~|{heading}|{navigation}|{item}|{icon}|{title}|{author}|{volume}|{iconplaypause}|{source}|{speakerlist[:200]}|{onoffbutton}" + command = f"entityUpd~{heading}~{navigation}~{item}~{icon}~{title}~{author}~{volume}~{iconplaypause}~{source}~{speakerlist[:200]}~{onoffbutton}" self._send_mqtt_msg(command) def generate_alarm_page(self, navigation, entity):