mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-22 07:24:24 +01:00
improve error handling navigation
This commit is contained in:
@@ -241,9 +241,13 @@ class LuiController(object):
|
|||||||
if button_type == "button":
|
if button_type == "button":
|
||||||
if entity_id.startswith('navigate'):
|
if entity_id.startswith('navigate'):
|
||||||
# internal for navigation to nested pages
|
# internal for navigation to nested pages
|
||||||
self._previous_cards.append(self._current_card)
|
dstCard = self._config.searchCard(entity_id)
|
||||||
self._current_card = self._config.searchCard(entity_id)
|
if dstCard is not None:
|
||||||
self._pages_gen.render_card(self._current_card)
|
self._previous_cards.append(self._current_card)
|
||||||
|
self._current_card = dstCard
|
||||||
|
self._pages_gen.render_card(self._current_card)
|
||||||
|
else:
|
||||||
|
self._ha_api.log(f"No page with key {entity_id} found")
|
||||||
elif entity_id.startswith('scene'):
|
elif entity_id.startswith('scene'):
|
||||||
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
self._ha_api.get_entity(entity_id).call_service("turn_on")
|
||||||
elif entity_id.startswith('script'):
|
elif entity_id.startswith('script'):
|
||||||
|
|||||||
Reference in New Issue
Block a user