added default card after screensaver exit

This commit is contained in:
Johannes
2022-04-03 11:28:11 +02:00
parent ab74c80ab2
commit aadebf801a
4 changed files with 41 additions and 32 deletions

View File

@@ -133,6 +133,13 @@ class LuiController(object):
LOGGER.info(f"Button Press Event; entity_id: {entity_id}; button_type: {button_type}; value: {value} ")
# internal buttons
if entity_id == "screensaver" and button_type == "bExit":
# get default card if there is one
if self._config.get("screensaver.defaultCard") is not None:
dstCard = self._config.searchCard(self._config.get("screensaver.defaultCard"))
if dstCard is not None:
self._previous_cards = []
self._current_card = dstCard
# check for duouble tap if configured and render current page
if self._config.get("doubleTapToUnlock") and int(value) >= 2:
self._pages_gen.render_card(self._current_card)
elif not self._config.get("doubleTapToUnlock"):