From 882b24ace12dfdc101a1c22bdf9d860161079bce Mon Sep 17 00:00:00 2001 From: illuzn <57167030+illuzn@users.noreply.github.com> Date: Sat, 18 Jun 2022 23:46:48 +0930 Subject: [PATCH 01/17] Enable Status Icon Override --- apps/nspanel-lovelace-ui/luibackend/pages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 3a718474..3614af8d 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -167,7 +167,7 @@ class LuiPagesGen(object): if page_search_res is not None: name = name if name is not None else page_search_res.title text = get_translation(self._locale, "frontend.ui.card.button.press") - icon_id = get_icon_id(icon) if icon is not None else get_icon_id("gesture-tap-button") + status_entity = None if item.status is not None and self._ha_api.entity_exists(item.status): status_entity = self._ha_api.get_entity(item.status) icon_color = self.get_entity_color(status_entity) @@ -177,6 +177,7 @@ class LuiPagesGen(object): icon_id = icon_id[:-1] else: icon_color = 17299 + icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) if icon is not None else get_icon_id("gesture-tap-button") return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~" From 01618e8c2110561de1cc556284450c023de07a6e Mon Sep 17 00:00:00 2001 From: illuzn <57167030+illuzn@users.noreply.github.com> Date: Sat, 18 Jun 2022 23:52:30 +0930 Subject: [PATCH 02/17] Update pages.py --- apps/nspanel-lovelace-ui/luibackend/pages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 3614af8d..5ccda618 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -165,9 +165,10 @@ class LuiPagesGen(object): if entityType == "navigate": page_search_res = self._config.searchCard(entityId) if page_search_res is not None: + icon_id = get_icon_id("gesture-tap-button") + status_entity = None name = name if name is not None else page_search_res.title text = get_translation(self._locale, "frontend.ui.card.button.press") - status_entity = None if item.status is not None and self._ha_api.entity_exists(item.status): status_entity = self._ha_api.get_entity(item.status) icon_color = self.get_entity_color(status_entity) @@ -177,7 +178,8 @@ class LuiPagesGen(object): icon_id = icon_id[:-1] else: icon_color = 17299 - icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) if icon is not None else get_icon_id("gesture-tap-button") + if icon is not None: + icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~" From e0f55ef3b73adac05d267abe06a053032ea21768 Mon Sep 17 00:00:00 2001 From: illuzn <57167030+illuzn@users.noreply.github.com> Date: Sun, 19 Jun 2022 00:03:36 +0930 Subject: [PATCH 03/17] Fix logical flow --- apps/nspanel-lovelace-ui/luibackend/pages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 5ccda618..5c881621 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -179,7 +179,10 @@ class LuiPagesGen(object): else: icon_color = 17299 if icon is not None: - icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) + if status_entity is not None: + icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) + else: + icon_id = get_icon_id(icon) return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~" From 22478155d59192dd6d93465ddd69a8e223cb9198 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 16:39:42 +0200 Subject: [PATCH 04/17] Update pages.py --- apps/nspanel-lovelace-ui/luibackend/pages.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 5c881621..33060c32 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -165,32 +165,28 @@ class LuiPagesGen(object): if entityType == "navigate": page_search_res = self._config.searchCard(entityId) if page_search_res is not None: - icon_id = get_icon_id("gesture-tap-button") + icon_res = get_icon_id(icon) if icon is not None else get_icon_id("gesture-tap-button") status_entity = None name = name if name is not None else page_search_res.title text = get_translation(self._locale, "frontend.ui.card.button.press") if item.status is not None and self._ha_api.entity_exists(item.status): status_entity = self._ha_api.get_entity(item.status) + icon_res = get_icon_id_ha("sensor", state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon) icon_color = self.get_entity_color(status_entity) if item.status.startswith("sensor") and cardType == "cardGrid": - icon_id = status_entity.state[:4] - if icon_id[-1] == ".": - icon_id = icon_id[:-1] + icon_res = status_entity.state[:4] + if icon_res[-1] == ".": + icon_res = icon_res[:-1] else: icon_color = 17299 - if icon is not None: - if status_entity is not None: - icon_id = get_icon_id_ha("sensor", state=status_entity.state, overwrite=icon) - else: - icon_id = get_icon_id(icon) - return f"~button~{entityId}~{icon_id}~{icon_color}~{name}~{text}" + return f"~button~{entityId}~{icon_res}~{icon_color}~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~" if entityType == "iText": value = entityId.split(".", 2)[1] name = name if name is not None else "conf name missing" icon_id = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline") - return f"~text~{entityId}~{icon_id}~17299~{name}~{value}" + return f"~text~{entityId}~{icon_res}~17299~{name}~{value}" if not self._ha_api.entity_exists(entityId): return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml" From 49c9d8c88bf864175400c9d913fbd3f9bbf0a549 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 16:43:19 +0200 Subject: [PATCH 05/17] Update pages.py --- apps/nspanel-lovelace-ui/luibackend/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 33060c32..d789375f 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -171,7 +171,7 @@ class LuiPagesGen(object): text = get_translation(self._locale, "frontend.ui.card.button.press") if item.status is not None and self._ha_api.entity_exists(item.status): status_entity = self._ha_api.get_entity(item.status) - icon_res = get_icon_id_ha("sensor", state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon) + icon_res = get_icon_id_ha(item.status.split(".")[0], state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon) icon_color = self.get_entity_color(status_entity) if item.status.startswith("sensor") and cardType == "cardGrid": icon_res = status_entity.state[:4] From ce31129934ee1326ffdbffa515688c92c9d53b54 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 18 Jun 2022 16:56:28 +0200 Subject: [PATCH 06/17] fix --- apps/nspanel-lovelace-ui/luibackend/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index d789375f..3d4cb4f6 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -185,7 +185,7 @@ class LuiPagesGen(object): if entityType == "iText": value = entityId.split(".", 2)[1] name = name if name is not None else "conf name missing" - icon_id = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline") + icon_res = get_icon_id(icon) if icon is not None else get_icon_id("alert-circle-outline") return f"~text~{entityId}~{icon_res}~17299~{name}~{value}" if not self._ha_api.entity_exists(entityId): return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~Not found check~ apps.yaml" From 3002a7d2e0ab334e69dbdc2691afd87d573156d4 Mon Sep 17 00:00:00 2001 From: joBr99 Date: Sun, 19 Jun 2022 15:03:29 +0000 Subject: [PATCH 07/17] Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui (add nextion2text) --- HMI/US/landscape/diff-eu-version.txt | 34 ++++++++--- HMI/US/portrait/diff-eu-version.txt | 59 ++++++++---------- HMI/US/portrait/diff-filtered.txt | 61 +++++++++---------- .../n2t-out-visual/nspanel_US_P_Stats.txt | 8 +-- HMI/US/portrait/n2t-out-visual/popupLight.txt | 2 +- .../portrait/n2t-out-visual/popupShutter.txt | 2 +- HMI/US/portrait/n2t-out/popupLight.txt | 2 +- HMI/US/portrait/n2t-out/popupShutter.txt | 2 +- HMI/n2t-out-visual/nspanel_Stats.txt | 4 +- HMI/n2t-out-visual/popupShutter.txt | 3 + HMI/n2t-out/popupShutter.txt | 3 + 11 files changed, 96 insertions(+), 84 deletions(-) diff --git a/HMI/US/landscape/diff-eu-version.txt b/HMI/US/landscape/diff-eu-version.txt index 60c2cf77..ae4ab873 100644 --- a/HMI/US/landscape/diff-eu-version.txt +++ b/HMI/US/landscape/diff-eu-version.txt @@ -1,6 +1,6 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt ---- HMI/n2t-out/Program.s.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/landscape/n2t-out/Program.s.txt 2022-06-19 14:21:01.123214844 +0000 +--- HMI/n2t-out/Program.s.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/landscape/n2t-out/Program.s.txt 2022-06-19 15:03:28.220436240 +0000 @@ -11,6 +11,4 @@ // dim value int dimValue=40 @@ -9,8 +9,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/landscape/n2t-out/Program.s.txt - lcd_dev fffb 0002 0000 0020 page pageStartup diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt ---- HMI/n2t-out/pageStartup.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-06-19 14:21:01.123214844 +0000 +--- HMI/n2t-out/pageStartup.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/landscape/n2t-out/pageStartup.txt 2022-06-19 15:03:28.220436240 +0000 @@ -177,7 +177,7 @@ recmod=1 bauds=115200 @@ -21,8 +21,8 @@ diff -bur HMI/n2t-out/pageStartup.txt HMI/US/landscape/n2t-out/pageStartup.txt btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC diff -bur HMI/n2t-out/popupShutter.txt HMI/US/landscape/n2t-out/popupShutter.txt ---- HMI/n2t-out/popupShutter.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/landscape/n2t-out/popupShutter.txt 2022-06-19 14:21:01.123214844 +0000 +--- HMI/n2t-out/popupShutter.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/landscape/n2t-out/popupShutter.txt 2022-06-19 15:03:28.220436240 +0000 @@ -181,7 +181,7 @@ Touch Release Event // event,buttonPress2,internalNameEntity,positionSlider,50 @@ -59,7 +59,13 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/landscape/n2t-out/popupShutter.txt //send calc crc btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC -@@ -520,7 +520,6 @@ +@@ -515,13 +515,11 @@ + tsw bTLeft,0 + spstr strCommand.txt,bTLeft.txt,"~",13 + bTLeft.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTLeft.txt,"~",13 tsw bTLeft,1 bTLeft.pco=65535 @@ -67,7 +73,13 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/landscape/n2t-out/popupShutter.txt } // set icon bStop spstr strCommand.txt,tTmp.txt,"~",17 -@@ -534,10 +533,9 @@ +@@ -530,36 +528,24 @@ + tsw bTStop,0 + spstr strCommand.txt,bTStop.txt,"~",14 + bTStop.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTStop.txt,"~",14 tsw bTStop,1 bTStop.pco=65535 @@ -79,7 +91,11 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/landscape/n2t-out/popupShutter.txt if(tTmp.txt=="disable") { spstr strCommand.txt,bTRight.txt,"~",15 -@@ -548,15 +546,6 @@ + tsw bTRight,0 + bTRight.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTRight.txt,"~",15 tsw bTRight,1 bTRight.pco=65535 diff --git a/HMI/US/portrait/diff-eu-version.txt b/HMI/US/portrait/diff-eu-version.txt index 4a897f0a..1ee6df48 100644 --- a/HMI/US/portrait/diff-eu-version.txt +++ b/HMI/US/portrait/diff-eu-version.txt @@ -1,6 +1,6 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt ---- HMI/n2t-out/Program.s.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-19 14:21:00.515209751 +0000 +--- HMI/n2t-out/Program.s.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-19 15:03:27.756426330 +0000 @@ -11,6 +11,6 @@ // dim value int dimValue=40 @@ -11,8 +11,8 @@ diff -bur HMI/n2t-out/Program.s.txt HMI/US/portrait/n2t-out/Program.s.txt + //lcd_dev fffb 0002 0000 0020 page pageStartup diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt ---- HMI/n2t-out/cardEntities.txt 2022-06-19 14:20:59.951205050 +0000 -+++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-19 14:21:00.515209751 +0000 +--- HMI/n2t-out/cardEntities.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-19 15:03:27.756426330 +0000 @@ -63,6 +63,16 @@ vis bText4,0 vis hSlider4,0 @@ -468,8 +468,8 @@ diff -bur HMI/n2t-out/cardEntities.txt HMI/US/portrait/n2t-out/cardEntities.txt if(tInstruction.txt=="pageType") { diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt ---- HMI/n2t-out/pageStartup.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-19 14:21:00.515209751 +0000 +--- HMI/n2t-out/pageStartup.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-19 15:03:27.756426330 +0000 @@ -142,7 +142,7 @@ Disable release event after dragging: 0 Send Component ID : disabled @@ -488,30 +488,9 @@ diff -bur HMI/n2t-out/pageStartup.txt HMI/US/portrait/n2t-out/pageStartup.txt //send calc crc btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC -diff -bur HMI/n2t-out/popupLight.txt HMI/US/portrait/n2t-out/popupLight.txt ---- HMI/n2t-out/popupLight.txt 2022-06-19 14:20:59.951205050 +0000 -+++ HMI/US/portrait/n2t-out/popupLight.txt 2022-06-19 14:21:00.515209751 +0000 -@@ -151,7 +151,7 @@ - Send Component ID : disabled - Associated Keyboard : none - Text : -- Max. Text Size : 80 -+ Max. Text Size : 10 - - Text tInstruction - Attributes diff -bur HMI/n2t-out/popupShutter.txt HMI/US/portrait/n2t-out/popupShutter.txt ---- HMI/n2t-out/popupShutter.txt 2022-06-19 14:20:59.947205019 +0000 -+++ HMI/US/portrait/n2t-out/popupShutter.txt 2022-06-19 14:21:00.515209751 +0000 -@@ -69,7 +69,7 @@ - Attributes - Scope : local - Text : -- Max. Text Size: 80 -+ Max. Text Size: 10 - - Text tEntity - Attributes +--- HMI/n2t-out/popupShutter.txt 2022-06-19 15:03:27.316416932 +0000 ++++ HMI/US/portrait/n2t-out/popupShutter.txt 2022-06-19 15:03:27.756426330 +0000 @@ -181,7 +181,7 @@ Touch Release Event // event,buttonPress2,internalNameEntity,positionSlider,50 @@ -548,7 +527,13 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/portrait/n2t-out/popupShutter.txt //send calc crc btlen tSend.txt,sys0 crcrest 1,0xffff // reset CRC -@@ -520,7 +520,6 @@ +@@ -515,13 +515,11 @@ + tsw bTLeft,0 + spstr strCommand.txt,bTLeft.txt,"~",13 + bTLeft.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTLeft.txt,"~",13 tsw bTLeft,1 bTLeft.pco=65535 @@ -556,7 +541,13 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/portrait/n2t-out/popupShutter.txt } // set icon bStop spstr strCommand.txt,tTmp.txt,"~",17 -@@ -534,10 +533,9 @@ +@@ -530,36 +528,24 @@ + tsw bTStop,0 + spstr strCommand.txt,bTStop.txt,"~",14 + bTStop.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTStop.txt,"~",14 tsw bTStop,1 bTStop.pco=65535 @@ -568,7 +559,11 @@ diff -bur HMI/n2t-out/popupShutter.txt HMI/US/portrait/n2t-out/popupShutter.txt if(tTmp.txt=="disable") { spstr strCommand.txt,bTRight.txt,"~",15 -@@ -548,15 +546,6 @@ + tsw bTRight,0 + bTRight.pco=27501 +- vis bTRight,1 + }else if(tTmp.txt=="enable") + { spstr strCommand.txt,bTRight.txt,"~",15 tsw bTRight,1 bTRight.pco=65535 diff --git a/HMI/US/portrait/diff-filtered.txt b/HMI/US/portrait/diff-filtered.txt index 31bec3d6..dd05ffd4 100644 --- a/HMI/US/portrait/diff-filtered.txt +++ b/HMI/US/portrait/diff-filtered.txt @@ -1,8 +1,8 @@ -+++ HMI/US/portrait/diff-eu-version.txt 2022-06-19 14:21:00.535209919 +0000 -+--- HMI/n2t-out/Program.s.txt 2022-06-19 14:20:59.947205019 +0000 -++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-19 14:21:00.515209751 +0000 -+--- HMI/n2t-out/cardEntities.txt 2022-06-19 14:20:59.951205050 +0000 -++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-19 14:21:00.515209751 +0000 ++++ HMI/US/portrait/diff-eu-version.txt 2022-06-19 15:03:27.772426671 +0000 ++--- HMI/n2t-out/Program.s.txt 2022-06-19 15:03:27.316416932 +0000 +++++ HMI/US/portrait/n2t-out/Program.s.txt 2022-06-19 15:03:27.756426330 +0000 ++--- HMI/n2t-out/cardEntities.txt 2022-06-19 15:03:27.316416932 +0000 +++++ HMI/US/portrait/n2t-out/cardEntities.txt 2022-06-19 15:03:27.756426330 +0000 +@@ -63,6 +63,16 @@ +@@ -120,6 +130,18 @@ +@@ -156,6 +178,15 @@ @@ -14,32 +14,11 @@ +@@ -970,6 +1149,33 @@ +@@ -1075,6 +1281,28 @@ +@@ -1850,6 +2078,169 @@ -+--- HMI/n2t-out/pageStartup.txt 2022-06-19 14:20:59.947205019 +0000 -++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-19 14:21:00.515209751 +0000 -+diff -bur HMI/n2t-out/popupLight.txt HMI/US/portrait/n2t-out/popupLight.txt -+--- HMI/n2t-out/popupLight.txt 2022-06-19 14:20:59.951205050 +0000 -++++ HMI/US/portrait/n2t-out/popupLight.txt 2022-06-19 14:21:00.515209751 +0000 -+@@ -151,7 +151,7 @@ -+ Send Component ID : disabled -+ Associated Keyboard : none -+ Text : -+- Max. Text Size : 80 -++ Max. Text Size : 10 -+ -+ Text tInstruction -+ Attributes ++--- HMI/n2t-out/pageStartup.txt 2022-06-19 15:03:27.316416932 +0000 +++++ HMI/US/portrait/n2t-out/pageStartup.txt 2022-06-19 15:03:27.756426330 +0000 +diff -bur HMI/n2t-out/popupShutter.txt HMI/US/portrait/n2t-out/popupShutter.txt -+--- HMI/n2t-out/popupShutter.txt 2022-06-19 14:20:59.947205019 +0000 -++++ HMI/US/portrait/n2t-out/popupShutter.txt 2022-06-19 14:21:00.515209751 +0000 -+@@ -69,7 +69,7 @@ -+ Attributes -+ Scope : local -+ Text : -+- Max. Text Size: 80 -++ Max. Text Size: 10 -+ -+ Text tEntity -+ Attributes ++--- HMI/n2t-out/popupShutter.txt 2022-06-19 15:03:27.316416932 +0000 +++++ HMI/US/portrait/n2t-out/popupShutter.txt 2022-06-19 15:03:27.756426330 +0000 +@@ -181,7 +181,7 @@ + Touch Release Event + // event,buttonPress2,internalNameEntity,positionSlider,50 @@ -76,7 +55,13 @@ + //send calc crc + btlen tSend.txt,sys0 + crcrest 1,0xffff // reset CRC -+@@ -520,7 +520,6 @@ ++@@ -515,13 +515,11 @@ ++ tsw bTLeft,0 ++ spstr strCommand.txt,bTLeft.txt,"~",13 ++ bTLeft.pco=27501 ++- vis bTRight,1 ++ }else if(tTmp.txt=="enable") ++ { + spstr strCommand.txt,bTLeft.txt,"~",13 + tsw bTLeft,1 + bTLeft.pco=65535 @@ -84,7 +69,13 @@ + } + // set icon bStop + spstr strCommand.txt,tTmp.txt,"~",17 -+@@ -534,10 +533,9 @@ ++@@ -530,36 +528,24 @@ ++ tsw bTStop,0 ++ spstr strCommand.txt,bTStop.txt,"~",14 ++ bTStop.pco=27501 ++- vis bTRight,1 ++ }else if(tTmp.txt=="enable") ++ { + spstr strCommand.txt,bTStop.txt,"~",14 + tsw bTStop,1 + bTStop.pco=65535 @@ -95,7 +86,11 @@ + if(tTmp.txt=="disable") + { + spstr strCommand.txt,bTRight.txt,"~",15 -+@@ -548,15 +546,6 @@ ++ tsw bTRight,0 ++ bTRight.pco=27501 ++- vis bTRight,1 ++ }else if(tTmp.txt=="enable") ++ { + spstr strCommand.txt,bTRight.txt,"~",15 + tsw bTRight,1 + bTRight.pco=65535 diff --git a/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt b/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt index d504f983..e9a68153 100644 --- a/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt +++ b/HMI/US/portrait/n2t-out-visual/nspanel_US_P_Stats.txt @@ -18,6 +18,10 @@ cardQR 32 Component(s) 374 Line(s) of event code 218 Unique line(s) of event code +popupLight + 27 Component(s) + 353 Line(s) of event code + 193 Unique line(s) of event code popupNotify 17 Component(s) 204 Line(s) of event code @@ -38,10 +42,6 @@ screensaver 38 Component(s) 319 Line(s) of event code 253 Unique line(s) of event code -popupLight - 27 Component(s) - 353 Line(s) of event code - 193 Unique line(s) of event code cardEntities 77 Component(s) 1363 Line(s) of event code diff --git a/HMI/US/portrait/n2t-out-visual/popupLight.txt b/HMI/US/portrait/n2t-out-visual/popupLight.txt index 05aac277..ee115234 100644 --- a/HMI/US/portrait/n2t-out-visual/popupLight.txt +++ b/HMI/US/portrait/n2t-out-visual/popupLight.txt @@ -320,7 +320,7 @@ Text tTmp Vertical Alignment : center Input Type : character Text : - Max. Text Size : 10 + Max. Text Size : 80 Word wrap : disabled Horizontal Spacing : 0 Vertical Spacing : 0 diff --git a/HMI/US/portrait/n2t-out-visual/popupShutter.txt b/HMI/US/portrait/n2t-out-visual/popupShutter.txt index b3fedb66..40c07549 100644 --- a/HMI/US/portrait/n2t-out-visual/popupShutter.txt +++ b/HMI/US/portrait/n2t-out-visual/popupShutter.txt @@ -82,7 +82,7 @@ Variable (string) tTmp ID : 19 Scope : local Text : - Max. Text Size: 10 + Max. Text Size: 80 Text tEntity Attributes diff --git a/HMI/US/portrait/n2t-out/popupLight.txt b/HMI/US/portrait/n2t-out/popupLight.txt index a8018887..e0c25405 100644 --- a/HMI/US/portrait/n2t-out/popupLight.txt +++ b/HMI/US/portrait/n2t-out/popupLight.txt @@ -151,7 +151,7 @@ Text tTmp Send Component ID : disabled Associated Keyboard : none Text : - Max. Text Size : 10 + Max. Text Size : 80 Text tInstruction Attributes diff --git a/HMI/US/portrait/n2t-out/popupShutter.txt b/HMI/US/portrait/n2t-out/popupShutter.txt index e70908fe..f4bf96d5 100644 --- a/HMI/US/portrait/n2t-out/popupShutter.txt +++ b/HMI/US/portrait/n2t-out/popupShutter.txt @@ -69,7 +69,7 @@ Variable (string) tTmp Attributes Scope : local Text : - Max. Text Size: 10 + Max. Text Size: 80 Text tEntity Attributes diff --git a/HMI/n2t-out-visual/nspanel_Stats.txt b/HMI/n2t-out-visual/nspanel_Stats.txt index f229eae6..388bfb17 100644 --- a/HMI/n2t-out-visual/nspanel_Stats.txt +++ b/HMI/n2t-out-visual/nspanel_Stats.txt @@ -20,7 +20,7 @@ popupNotify 128 Unique line(s) of event code popupShutter 25 Component(s) - 341 Line(s) of event code + 344 Line(s) of event code 175 Unique line(s) of event code cardMedia 34 Component(s) @@ -58,5 +58,5 @@ cardEntities Total 13 Page(s) 412 Component(s) - 4655 Line(s) of event code + 4658 Line(s) of event code 1245 Unique line(s) of event code diff --git a/HMI/n2t-out-visual/popupShutter.txt b/HMI/n2t-out-visual/popupShutter.txt index ebcccf63..637b6f5a 100644 --- a/HMI/n2t-out-visual/popupShutter.txt +++ b/HMI/n2t-out-visual/popupShutter.txt @@ -844,6 +844,7 @@ Timer tmSerial tsw bTLeft,0 spstr strCommand.txt,bTLeft.txt,"~",13 bTLeft.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTLeft.txt,"~",13 @@ -858,6 +859,7 @@ Timer tmSerial tsw bTStop,0 spstr strCommand.txt,bTStop.txt,"~",14 bTStop.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTStop.txt,"~",14 @@ -872,6 +874,7 @@ Timer tmSerial spstr strCommand.txt,bTRight.txt,"~",15 tsw bTRight,0 bTRight.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTRight.txt,"~",15 diff --git a/HMI/n2t-out/popupShutter.txt b/HMI/n2t-out/popupShutter.txt index 6d610623..d32a3f92 100644 --- a/HMI/n2t-out/popupShutter.txt +++ b/HMI/n2t-out/popupShutter.txt @@ -515,6 +515,7 @@ Timer tmSerial tsw bTLeft,0 spstr strCommand.txt,bTLeft.txt,"~",13 bTLeft.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTLeft.txt,"~",13 @@ -529,6 +530,7 @@ Timer tmSerial tsw bTStop,0 spstr strCommand.txt,bTStop.txt,"~",14 bTStop.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTStop.txt,"~",14 @@ -543,6 +545,7 @@ Timer tmSerial spstr strCommand.txt,bTRight.txt,"~",15 tsw bTRight,0 bTRight.pco=27501 + vis bTRight,1 }else if(tTmp.txt=="enable") { spstr strCommand.txt,bTRight.txt,"~",15 From 2173b5c5cf5a6777801f880954975edcc655f860 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 19 Jun 2022 17:13:11 +0200 Subject: [PATCH 08/17] Add fix for Hebrew on Nspanel (Reverse every string in locale file) --- HMI/code_gen/localization/iobroker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HMI/code_gen/localization/iobroker.py b/HMI/code_gen/localization/iobroker.py index b6dcb74d..6bc53529 100644 --- a/HMI/code_gen/localization/iobroker.py +++ b/HMI/code_gen/localization/iobroker.py @@ -57,6 +57,8 @@ def lookup(path_frontend_file, path_backend_file, lookupstr): def get_translation(locale, lookupstr): path_frontend_file, path_backend_file = build_locale_filestring(locale) res = lookup(path_frontend_file, path_backend_file, lookupstr) + if locale == "he_IL": + res = res[::-1] return res out = defaultdict(lambda: defaultdict(lambda: defaultdict(dict))) From f6523096657cc669a386ebf72cd9bcf6277bd7c4 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 19 Jun 2022 17:53:48 +0200 Subject: [PATCH 09/17] Update faq.md --- docs/faq.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index bc9a3133..b3ca190c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -68,12 +68,12 @@ Click download. 2. Restart AppDaemon -3. Flash current Development Firmware in Tasmota Console. DO NOT USE THIS URL (only if you are on main/dev) +3. Flash current Development Firmware in Tasmota Console. DO NOT USE THIS VERSION/URLS IF YOUR ARE NOT ON THE DEVELOPMENT VERSION -`FlashNextion http://nspanel.pky.eu/lui.tft` DO NOT USE THIS URL (only if you are on main/dev) +EU VERSION: `FlashNextion http://nspanel.pky.eu/lui.tft` Development happens in the EU version, so it is possible that the US Version isn't up to date with the current development version of the EU firmware, the lastet US versions are still downloadable with the following links: -`FlashNextion http://nspanel.pky.eu/lui-us-l.tft` DO NOT USE THIS URL (only if you are on main/dev) +US LANDSCAPE: `FlashNextion http://nspanel.pky.eu/lui-us-l.tft` -`FlashNextion http://nspanel.pky.eu/lui-us-p.tft` DO NOT USE THIS URL (only if you are on main/dev) +US PORTRAIT: `FlashNextion http://nspanel.pky.eu/lui-us-p.tft` From 87b4367abc38fda7d11c6799d8d7d48e288ce07b Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 19 Jun 2022 19:24:49 +0200 Subject: [PATCH 10/17] Update feature-request.md --- .github/ISSUE_TEMPLATE/feature-request.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 835831f8..47fbdc40 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -9,7 +9,7 @@ assignees: '' ### FEATURE DESCRIPTION -_A clear and concise description of what the problem is._ - +_A clear and concise description of what the feature should do._ ### ADDITIONAL CONTEXT _Add any other context about the problem here._ From b6af8060affc310ebf7cd9350f9a1eed52d729ca Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 19 Jun 2022 19:49:17 +0200 Subject: [PATCH 11/17] Update issue-close-app.yml --- .github/issue-close-app.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/issue-close-app.yml b/.github/issue-close-app.yml index 0ada963a..b1b353ea 100644 --- a/.github/issue-close-app.yml +++ b/.github/issue-close-app.yml @@ -5,26 +5,20 @@ # Comment that will be sent if an issue is judged to be closed. comment: >- - This issue has been automatically closed because the PROBLEM REPORT TEMPLATE is missing or incomplete. + This issue has been automatically closed because the TEMPLATE is missing or incomplete. Filling the template is required so standard questions don't need to be asked again each time. - Our ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template + THe ability to provide assistance is greatly hampered if few minutes are not taken to complete the issue template with the requested information. The details requested potentially affect which options to pursue. The small amount of time you will spend completing the template will also help the volunteers, providing assistance to you, to reduce the time required to help you. - Please, could you be so kind on completing the [PROBLEM REPORT TEMPLATE](https://github.com/arendst/Tasmota/issues/new/choose) in order to have more information so as to properly help you? + Please, could you be so kind on completing the [REPORT TEMPLATE](https://github.com/joBr99/nspanel-lovelace-ui/issues/new/choose) in order to have more information so as to properly help you? Thank you for taking the time to report, hopefully it can be resolved soon. - [Docs](https://tasmota.github.io/docs/) for more information. + [Docs](https://docs.nspanel.pky.eu) for more information. - [Discussions](https://github.com/arendst/Tasmota/discussions) for Questions, Feature Requests and Projects. - - [Chat](https://discord.gg/Ks2Kzd4) for more users experience. - - Please check the [Code of Conduct](https://github.com/arendst/Tasmota/blob/development/CODE_OF_CONDUCT.md) and the [Contributing Guideline and Policy](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md) - issueConfigs: # There can be several configs for different kind of issues. - content: @@ -48,4 +42,4 @@ caseInsensitive: true # The bot will only add a label if this property is set. label: "template missing/incomplete" # The issue is judged to be legal if it includes all keywords from any of these two configs. -# Or it will be closed by the app. \ No newline at end of file +# Or it will be closed by the app. From 0fb0ed758a9b864ec8e422b83d05acf26f407c32 Mon Sep 17 00:00:00 2001 From: Armilar <102996011+Armilar@users.noreply.github.com> Date: Sun, 19 Jun 2022 21:43:05 +0200 Subject: [PATCH 12/17] ALIAS "socket" and "light" with optional OFF-Icon Example: Line 224 --- ioBroker/NsPanelTs.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index cd0de7c0..4ecdfcb0 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -23,6 +23,7 @@ ReleaseNotes: - 19.06.2022 - V3.1.0 - Bugfix toLocalTimeString in en-EN/en-US - 19.06.2022 - V3.1.0 - Fehler in findLocale abgefangen - 19.06.2022 - V3.1.0 - Umstellung auf "Home Assistant" Sprachfile + - 19.06.2022 - V3.1.0 - Alias "light" und "socket" haben optionalen Parameter icon2 für negative Zustände Known Bug - Github Issue #286 @@ -148,7 +149,7 @@ var weatherForecast = true; //true = WheatherForecast 5 Days --- false = Config //Alexa-Instanz var alexaInstanz = "alexa2.0" -var alexaDevice = "G0XXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer) +var alexaDevice = "G0XXXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer) // Wenn alexaSpeakerList definiert, dann werden Einträge verwendet, sonst alle relevanten Devices aus Alexa-Instanz // Speakerwechsel funktioniert nicht bei Radio/TuneIn sonden bei Playlists @@ -219,7 +220,8 @@ var Buero_Seite_1: PageEntities = { id: "alias.0.NSPanel_1.Schreibtischlampe", interpolateColor: true}, { id: "alias.0.NSPanel_1.Deckenbeleuchtung", interpolateColor: true}, { id: "alias.0.NSPanel_1.Testlampe2", name: "Filamentlampe", minValueBrightness: 0, maxValueBrightness: 70, interpolateColor: true}, - { id: "alias.0.NSPanel_1.Luftreiniger", icon: "power", offColor: MSRed, onColor: MSGreen} + //{ id: "alias.0.NSPanel_1.Luftreiniger", icon: "power", icon2: "",offColor: MSRed, onColor: MSGreen} + { id: "alias.0.NSPanel_1.TestVentil1", icon: "valve-open", icon2: "valve-closed",offColor: MSRed, onColor: MSGreen} //based on socket ] }; @@ -451,7 +453,7 @@ export const config: Config = { dimmode: 8, active: 100, //Standard-Brightness TFT screenSaverDoubleClick: false, - locale: "en-US", //en-US, de-DE, nl-NL, da-DK, es-ES, fr-FR, it-IT, ru-RU, etc. + locale: "de-DE", //en-US, de-DE, nl-NL, da-DK, es-ES, fr-FR, it-IT, ru-RU, etc. timeFormat: "%H:%M", //currently not used dateFormat: "%A, %d. %B %Y", //currently not used weatherEntity: "alias.0.Wetter", @@ -1095,6 +1097,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = case "light": type = "light" iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == "socket" ? Icons.GetIcon("power-socket-de") : Icons.GetIcon("lightbulb"); + var iconId2 = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == "socket" ? Icons.GetIcon("power-socket-de") : Icons.GetIcon("lightbulb"); var optVal = "0" if (val === true || val === "true") { @@ -1102,6 +1105,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = iconColor = GetIconColor(pageItem, true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); + iconId = iconId2; } return "~" + type + "~" + pageItem.id + "~" + iconId + "~" + iconColor + "~" + name + "~" + optVal; @@ -2960,6 +2964,7 @@ interface PageQR extends Page { type PageItem = { id: string, icon: (string | undefined), + icon2: (string | undefined), onColor: (RGB | undefined), offColor: (RGB | undefined), useColor: (boolean | undefined), From 29cbd4f448ce28a8ecb52a46779cc7e65766e2a4 Mon Sep 17 00:00:00 2001 From: Armilar <102996011+Armilar@users.noreply.github.com> Date: Mon, 20 Jun 2022 00:34:09 +0200 Subject: [PATCH 13/17] Fix Icon-Off (socket/light) --- ioBroker/NsPanelTs.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 4ecdfcb0..62a9cd7d 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -149,7 +149,7 @@ var weatherForecast = true; //true = WheatherForecast 5 Days --- false = Config //Alexa-Instanz var alexaInstanz = "alexa2.0" -var alexaDevice = "G0XXXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer) +var alexaDevice = "G0XXXXXXXXXXXXXX"; //Primär zu steuerndes Device oder Gruppe aus alexa2-Adapter (Seriennummer) // Wenn alexaSpeakerList definiert, dann werden Einträge verwendet, sonst alle relevanten Devices aus Alexa-Instanz // Speakerwechsel funktioniert nicht bei Radio/TuneIn sonden bei Playlists @@ -221,7 +221,7 @@ var Buero_Seite_1: PageEntities = { id: "alias.0.NSPanel_1.Deckenbeleuchtung", interpolateColor: true}, { id: "alias.0.NSPanel_1.Testlampe2", name: "Filamentlampe", minValueBrightness: 0, maxValueBrightness: 70, interpolateColor: true}, //{ id: "alias.0.NSPanel_1.Luftreiniger", icon: "power", icon2: "",offColor: MSRed, onColor: MSGreen} - { id: "alias.0.NSPanel_1.TestVentil1", icon: "valve-open", icon2: "valve-closed",offColor: MSRed, onColor: MSGreen} //based on socket + { id: "alias.0.NSPanel_1.Luftreiniger", icon: "valve-open", icon2: "valve-closed",offColor: MSRed, onColor: MSGreen, name: "Test-Ventil 1"} ] }; @@ -1097,7 +1097,7 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = case "light": type = "light" iconId = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon) : o.common.role == "socket" ? Icons.GetIcon("power-socket-de") : Icons.GetIcon("lightbulb"); - var iconId2 = pageItem.icon !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == "socket" ? Icons.GetIcon("power-socket-de") : Icons.GetIcon("lightbulb"); + var iconId2 = pageItem.icon2 !== undefined ? Icons.GetIcon(pageItem.icon2) : o.common.role == "socket" ? Icons.GetIcon("power-socket-de") : Icons.GetIcon("lightbulb"); var optVal = "0" if (val === true || val === "true") { @@ -1105,7 +1105,11 @@ function CreateEntity(pageItem: PageItem, placeId: number, useColors: boolean = iconColor = GetIconColor(pageItem, true, useColors); } else { iconColor = GetIconColor(pageItem, false, useColors); - iconId = iconId2; + if (pageItem.icon !== undefined) { + if (pageItem.icon2 !== undefined) { + iconId = iconId2; + } + } } return "~" + type + "~" + pageItem.id + "~" + iconId + "~" + iconColor + "~" + name + "~" + optVal; From cb530de2bde9b5074089fc7a9162ebde265eee25 Mon Sep 17 00:00:00 2001 From: Armilar <102996011+Armilar@users.noreply.github.com> Date: Tue, 21 Jun 2022 15:34:05 +0200 Subject: [PATCH 14/17] Fix #286 --- ioBroker/NsPanelTs.ts | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/ioBroker/NsPanelTs.ts b/ioBroker/NsPanelTs.ts index 62a9cd7d..9ce83fd1 100644 --- a/ioBroker/NsPanelTs.ts +++ b/ioBroker/NsPanelTs.ts @@ -184,7 +184,7 @@ var Test_Licht: PageEntities = "heading": "Color Aliase", "useColor": true, "subPage": false, - "parent": Test_Licht, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.TestRGBLichteinzeln", name: "RGB-Licht Hex-Color", interpolateColor: true}, //{ id: "alias.0.NSPanel_1.TestFarbtemperatur", name: "Farbtemperatur", interpolateColor: true}, @@ -200,7 +200,7 @@ var Test_Funktionen: PageEntities = "heading": "Sonstige Aliase", "useColor": true, "subPage": false, - "parent": Test_Funktionen, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.TestLautstärke", offColor: MSRed /*if mute=true*/, onColor: MSGreen ,name: "Echo Spot Büro", minValue: 0, maxValue: 100}, { id: "alias.0.NSPanel_1.TestTemperatur",name: "Temperatur außen", icon: "thermometer", onColor: White}, @@ -215,13 +215,13 @@ var Buero_Seite_1: PageEntities = "heading": "Büro", "useColor": true, "subPage": false, - "parent": Buero_Seite_1, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.Schreibtischlampe", interpolateColor: true}, { id: "alias.0.NSPanel_1.Deckenbeleuchtung", interpolateColor: true}, { id: "alias.0.NSPanel_1.Testlampe2", name: "Filamentlampe", minValueBrightness: 0, maxValueBrightness: 70, interpolateColor: true}, - //{ id: "alias.0.NSPanel_1.Luftreiniger", icon: "power", icon2: "",offColor: MSRed, onColor: MSGreen} - { id: "alias.0.NSPanel_1.Luftreiniger", icon: "valve-open", icon2: "valve-closed",offColor: MSRed, onColor: MSGreen, name: "Test-Ventil 1"} + { id: "alias.0.NSPanel_1.Luftreiniger", icon: "power", icon2: "",offColor: MSRed, onColor: MSGreen} + //{ id: "alias.0.NSPanel_1.TestVentil1", icon: "valve-open", icon2: "valve-closed",offColor: MSRed, onColor: MSGreen, name: "Test-Ventil 1"} ] }; @@ -231,7 +231,7 @@ var Fenster_1: PageEntities = "heading": "Fenster und Türen", "useColor": true, "subPage": false, - "parent": Fenster_1, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.TestFenster", offColor: MSRed, onColor: MSGreen, name: "Büro Fenster"}, { id: "alias.0.NSPanel_1.Haustuer", offColor: MSRed, onColor: MSGreen, name: "Haustür"}, @@ -246,7 +246,7 @@ var Button_1: PageEntities = "heading": "Button Aliase", "useColor": true, "subPage": false, - "parent": Button_1, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.TestTastensensor", name: "Tastensensor (FFN)"}, { id: "alias.0.NSPanel_1.Radio.NDR2", icon: "radio", name: "Taste (NDR2)", onColor: colorRadio}, @@ -259,7 +259,7 @@ var Subpages_1: PageEntities = "heading": "Test Subpages", "useColor": true, "subPage": false, - "parent": Subpages_1, + "parent": undefined, "items": [ { navigate: true, id: "Abfall", onColor: White, name: "Abfallkalender"}, { navigate: true, id: "WLAN", onColor: White, name: "Gäste WLAN"}, @@ -288,7 +288,7 @@ var Buero_Seite_2: PageGrid = "heading": "Büro 2", "useColor": true, "subPage": false, - "parent": Buero_Seite_2, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.Schreibtischlampe", name: "Schreibtisch"}, { id: "alias.0.NSPanel_1.Deckenbeleuchtung", name: "Deckenlampe"}, @@ -305,7 +305,7 @@ var Alexa: PageMedia = "heading": "Alexa", "useColor": true, "subPage": false, - "parent": Alexa, + "parent": undefined, "items": [{ id: "alias.0.NSPanel_1.Alexa.PlayerBuero" }] }; @@ -315,7 +315,7 @@ var Buero_Themostat: PageThermo = "heading": "Test Thermostat", "useColor": true, "subPage": false, - "parent": Buero_Themostat, + "parent": undefined, "items": [{ id: "alias.0.NSPanel_1.Thermostat_Büro", minValue: 50, maxValue: 300 }] }; @@ -325,7 +325,7 @@ var Buero_Klimaanlage: PageThermo = "heading": "Test Klimaanlage", "useColor": true, "subPage": false, - "parent": Buero_Klimaanlage, + "parent": undefined, "items": [{ id: "alias.0.NSPanel_1.TestKlimaanlage", minValue: 170, maxValue: 250}] }; @@ -346,7 +346,7 @@ var Buero_Alarm: PageAlarm = "heading": "Alarm", "useColor": true, "subPage": false, - "parent": Buero_Alarm, + "parent": undefined, "items": [{ id: "alias.0.NSPanel_1.Alarm" }] }; @@ -356,7 +356,7 @@ var button1Page: PageGrid = "heading": "Radio", "useColor": true, "subPage": false, - "parent": button1Page, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.Radio.FFN", icon: "radio", name: "FFN", onColor: colorRadio}, { id: "alias.0.NSPanel_1.Radio.Antenne" , icon: "radio", name: "Antenne Nds.", onColor: colorRadio}, @@ -373,7 +373,7 @@ var button2Page: PageEntities = "heading": "Büro", "useColor": true, "subPage": false, - "parent": button2Page, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.Schreibtischlampe"}, { id: "alias.0.NSPanel_1.Deckenbeleuchtung"} @@ -387,7 +387,7 @@ var Service: PageEntities = "heading": "NSPanel Service", "useColor": true, "subPage": false, - "parent": Service, + "parent": undefined, "items": [ { id: "alias.0.NSPanel_1.NSPanel_AutoUpdate", name: "Auto-Updates" ,icon: "update", offColor: MSRed, onColor: MSGreen}, { navigate: true, id: "NSPanel_Infos", icon: "information-outline", onColor: White, name: "NSPanel Infos"}, @@ -561,7 +561,6 @@ check_updates(); function get_locales() { exec('curl https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/ioBroker/ioBroker_NSPanel_locales.json', function (error, result, stderr){ if (result) { - let BerryDriverVersionOnline = result.substring((result.indexOf("version_of_this_script = ") + 24), result.indexOf("version_of_this_script = ") + 27).replace(/\s+/g, ''); createState(NSPanel_Path + "NSPanel_locales_json"); var timer = setTimeout(function() { setIfExists(NSPanel_Path + 'NSPanel_locales_json', result); @@ -1989,9 +1988,7 @@ function HandleButtonEvent(words): void { } } else { if (Debug) console.log("bExit: " + words[4] + " - "+ pageId) - //Known Bug GitHub Issue #286 - //GeneratePage(activePage); - GeneratePage(config.pages[pageId]); + GeneratePage(activePage); } break; case "notifyAction": From 3e3022b212de9a847ae1a5a5a2155388b47ef60e Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 21 Jun 2022 19:06:00 +0200 Subject: [PATCH 15/17] Update issue-close-app.yml --- .github/issue-close-app.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/issue-close-app.yml b/.github/issue-close-app.yml index b1b353ea..0ca36c87 100644 --- a/.github/issue-close-app.yml +++ b/.github/issue-close-app.yml @@ -43,3 +43,6 @@ caseInsensitive: true label: "template missing/incomplete" # The issue is judged to be legal if it includes all keywords from any of these two configs. # Or it will be closed by the app. +exception: + - "joBr99" + - "Armilar" From 90749471174842260a941b1ebadd679814016d7a Mon Sep 17 00:00:00 2001 From: illuzn <57167030+illuzn@users.noreply.github.com> Date: Wed, 22 Jun 2022 03:02:32 +0930 Subject: [PATCH 16/17] fix nav icon overwrite * Fixes typo The logic doesn't quite work because if icon is a dict then it tries to call get_icon_id which expects a string icon. * Wrong code committed - my bad * Update icons.py * Update pages.py Co-authored-by: Johannes --- apps/nspanel-lovelace-ui/luibackend/icons.py | 2 +- apps/nspanel-lovelace-ui/luibackend/pages.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/icons.py b/apps/nspanel-lovelace-ui/luibackend/icons.py index e3ae3c85..fcb58c9c 100644 --- a/apps/nspanel-lovelace-ui/luibackend/icons.py +++ b/apps/nspanel-lovelace-ui/luibackend/icons.py @@ -77,7 +77,7 @@ cover_mapping = { def map_to_mdi_name(ha_type, state=None, device_class="_", cardType=None): if ha_type == "weather": return weather_mapping[state] if state in weather_mapping else "alert-circle-outline" - elif ha_type == "button": + elif ha_type in ["button", "navigate"]: return "gesture-tap-button" elif ha_type == "scene": return "palette" diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 90b37de5..5290d0fc 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -165,7 +165,7 @@ class LuiPagesGen(object): if entityType == "navigate": page_search_res = self._config.searchCard(entityId) if page_search_res is not None: - icon_res = get_icon_id(icon) if icon is not None else get_icon_id("gesture-tap-button") + icon_res = get_icon_id_ha("navigate", overwrite=icon) status_entity = None name = name if name is not None else page_search_res.title text = get_translation(self._locale, "frontend.ui.card.button.press") From faca472ec53f98198572e42c9b7b84221f6357a8 Mon Sep 17 00:00:00 2001 From: Johannes Date: Tue, 21 Jun 2022 20:57:53 +0200 Subject: [PATCH 17/17] implements #298 --- apps/nspanel-lovelace-ui/luibackend/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/nspanel-lovelace-ui/luibackend/pages.py b/apps/nspanel-lovelace-ui/luibackend/pages.py index 5290d0fc..007c58fe 100644 --- a/apps/nspanel-lovelace-ui/luibackend/pages.py +++ b/apps/nspanel-lovelace-ui/luibackend/pages.py @@ -172,13 +172,13 @@ class LuiPagesGen(object): if item.status is not None and self._ha_api.entity_exists(item.status): status_entity = self._ha_api.get_entity(item.status) icon_res = get_icon_id_ha(item.status.split(".")[0], state=status_entity.state, device_class=status_entity.attributes.get("device_class", "_"), overwrite=icon) - icon_color = self.get_entity_color(status_entity) + icon_color = self.get_entity_color(entity, overwrite=colorOverride) if item.status.startswith("sensor") and cardType == "cardGrid": icon_res = status_entity.state[:4] if icon_res[-1] == ".": icon_res = icon_res[:-1] else: - icon_color = 17299 + icon_color = rgb_dec565(colorOverride) if colorOverride is not None and type(colorOverride) is list else 17299 return f"~button~{entityId}~{icon_res}~{icon_color}~{name}~{text}" else: return f"~text~{entityId}~{get_icon_id('alert-circle-outline')}~17299~page not found~"