From 6b120f292eaa40395e20e59664242a409c72fc98 Mon Sep 17 00:00:00 2001 From: joBr99 <29555657+joBr99@users.noreply.github.com> Date: Fri, 3 Feb 2023 20:00:39 +0100 Subject: [PATCH] Add navNext, navPrev for hardware button navigation #749 --- apps/nspanel-lovelace-ui/luibackend/controller.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/nspanel-lovelace-ui/luibackend/controller.py b/apps/nspanel-lovelace-ui/luibackend/controller.py index c82916c2..8d397a73 100644 --- a/apps/nspanel-lovelace-ui/luibackend/controller.py +++ b/apps/nspanel-lovelace-ui/luibackend/controller.py @@ -290,6 +290,14 @@ class LuiController(object): else: self._current_card = self._config.get_default_card() self._pages_gen.render_card(self._current_card) + if entity_id.startswith('navPrev'): + if self._current_card.uuid_prev: + self._current_card = self._config.get_card_by_uuid(self._current_card.uuid_prev) + self._pages_gen.render_card(self._current_card) + if entity_id.startswith('navNext'): + if self._current_card.uuid_next: + self._current_card = self._config.get_card_by_uuid(self._current_card.uuid_next) + self._pages_gen.render_card(self._current_card) elif entity_id.startswith('scene'): apis.ha_api.get_entity(entity_id).call_service("turn_on") elif entity_id.startswith('script'):