Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
joBr99 committed Nov 24, 2023
1 parent 349db17 commit c6e49bb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Binary file modified HMI/nspanel.HMI
Binary file not shown.
Binary file modified HMI/nspanel.tft
Binary file not shown.
2 changes: 1 addition & 1 deletion nspanel-lovelace-ui/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
name: NSPanel Lovelace UI Addon
version: "4.7.35"
version: "4.7.36"
slug: nspanel-lovelace-ui
description: NSPanel Lovelace UI Addon
services:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6914,7 +6914,6 @@ def get_icon_id(ma_name):
ma_name = re.sub(r'<I>.+?<\/I>', get_icon_id, ma_name)
print(f"test123d {ma_name}")


ma_name = ma_name.replace("mdi:", "")
if ma_name in icons:
return icons[ma_name]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def init(mqtt_client_from_manager):
def custom_send(topic, msg):
global mqtt_client
mqtt_client.publish(topic, msg)
logging.debug("Sent Message to NsPanel: %s", msg)
logging.debug("Sent Message to NsPanel (%s): %s", topic, msg)


def page_type(topic, target_page):
Expand Down
10 changes: 6 additions & 4 deletions nspanel-lovelace-ui/rootfs/usr/bin/mqtt-manager/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def ha_event_callback(self, entity_id):
self.dimmode()


def render_current_page(self, switchPages=False):
def render_current_page(self, switchPages=False, requested=False):
if switchPages:
libs.panel_cmd.page_type(self.sendTopic, self.current_card.type)

self.current_card.render()
if requested:
self.current_card.render()
# send sleepTimeout
sleepTimeout = self.settings.get("sleepTimeout", 20)
if self.current_card.config.get("sleepTimeout"):
Expand Down Expand Up @@ -155,7 +155,7 @@ def dimmode(self):


def customrecv_event_callback(self, msg):
logging.debug("Recv Message from NsPanel: %s", msg)
logging.debug("Recv Message from NsPanel (%s): %s", self.name, msg)
msg = msg.split(",")
# run action based on received command
if msg[0] == "event":
Expand All @@ -173,6 +173,8 @@ def customrecv_event_callback(self, msg):
self.privious_cards.append(self.current_card)
self.current_card = Screensaver(self.settings["locale"], self.settings["screensaver"], self)
self.render_current_page(switchPages=True)
if msg[1] == "renderCurrentPage":
self.render_current_page(requested=True)
if msg[1] == "buttonPress2":
entity_id = msg[2]
btype = msg[3]
Expand Down

0 comments on commit c6e49bb

Please sign in to comment.