Skip to content

Commit

Permalink
fixes #795
Browse files Browse the repository at this point in the history
  • Loading branch information
joBr99 committed Mar 5, 2023
1 parent fe401cc commit 20743c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions apps/nspanel-lovelace-ui/luibackend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ def __init__(self, card_input_config, hidden=False):
self.cardType = card_input_config.get("type", "unknown")
self.title = card_input_config.get("title", "unknown")
self.key = card_input_config.get("key", "unknown")
self.nav1Override = card_input_config.get("navItem1")
self.nav2Override = card_input_config.get("navItem2")
self.nav1Override = None
if card_input_config.get("navItem1"):
self.nav1Override = Entity(card_input_config.get("navItem1"))
self.nav2Override = None
if card_input_config.get("navItem2"):
self.nav2Override = Entity(card_input_config.get("navItem2"))
self.sleepTimeout = card_input_config.get("sleepTimeout")
self.last_update = 0
self.cooldown = card_input_config.get("cooldown", 0)
Expand Down
4 changes: 2 additions & 2 deletions apps/nspanel-lovelace-ui/luibackend/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,10 @@ def render_card(self, card, send_page_type=True):
rightBtn = "delete~~~~~"

if card.nav1Override is not None:
leftBtn = self.generate_entities_item(Entity(card.nav1Override))[1:]
leftBtn = self.generate_entities_item(card.nav1Override)[1:]

if card.nav2Override is not None:
rightBtn = self.generate_entities_item(Entity(card.nav2Override))[1:]
rightBtn = self.generate_entities_item(card.nav2Override)[1:]

navigation = f"{leftBtn}~{rightBtn}"

Expand Down

0 comments on commit 20743c3

Please sign in to comment.