From 9ca085e296e0253ed957fe8d57f228f1075d2ee8 Mon Sep 17 00:00:00 2001 From: joBr99 Date: Sun, 20 Mar 2022 00:14:24 +0000 Subject: [PATCH 1/3] Merge branch 'main' of https://github.com/joBr99/nspanel-lovelace-ui (add nextion2text) --- HMI/n2t-out/cardGrid.txt | 96 +++++++++++++++++------------------ HMI/n2t-out/nspanel_Stats.txt | 14 ++--- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/HMI/n2t-out/cardGrid.txt b/HMI/n2t-out/cardGrid.txt index 5634d000..1e101cb4 100644 --- a/HMI/n2t-out/cardGrid.txt +++ b/HMI/n2t-out/cardGrid.txt @@ -638,16 +638,13 @@ Button bEntity1 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type1.txt pageIcons.tTmp1.txt=tEntity1.txt pageIcons.tTmp2.txt=entn1.txt - if(type1.txt=="shutter") - { - page popupShutter - } - if(type1.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -702,16 +699,13 @@ Button bEntity2 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type2.txt pageIcons.tTmp1.txt=tEntity2.txt pageIcons.tTmp2.txt=entn2.txt - if(type2.txt=="shutter") - { - page popupShutter - } - if(type2.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -766,16 +760,13 @@ Button bEntity3 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type3.txt pageIcons.tTmp1.txt=tEntity3.txt pageIcons.tTmp2.txt=entn3.txt - if(type3.txt=="shutter") - { - page popupShutter - } - if(type3.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -830,16 +821,13 @@ Button bEntity4 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type4.txt pageIcons.tTmp1.txt=tEntity4.txt pageIcons.tTmp2.txt=entn4.txt - if(type4.txt=="shutter") - { - page popupShutter - } - if(type4.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -894,16 +882,13 @@ Button bEntity5 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type5.txt pageIcons.tTmp1.txt=tEntity5.txt pageIcons.tTmp2.txt=entn5.txt - if(type5.txt=="shutter") - { - page popupShutter - } - if(type5.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -958,16 +943,13 @@ Button bEntity6 Events Touch Press Event + tmLP.en=1 + tTmp.txt=type6.txt pageIcons.tTmp1.txt=tEntity6.txt pageIcons.tTmp2.txt=entn6.txt - if(type6.txt=="shutter") - { - page popupShutter - } - if(type6.txt=="light") - { - page popupLight - } + + Touch Release Event + tmLP.en=0 // event,1,tHeading,tEntityName,1,up //craft command // convert pageNumber and write to tTmp @@ -1308,6 +1290,24 @@ Timer tmSleep } } +Timer tmLP + Attributes + ID : 38 + Scope : local + Period (ms): 500 + Enabled : no + + Events + Timer Event + if(tTmp.txt=="shutter") + { + page popupShutter + } + if(tTmp.txt=="light") + { + page popupLight + } + TouchCap tc0 Attributes ID : 22 diff --git a/HMI/n2t-out/nspanel_Stats.txt b/HMI/n2t-out/nspanel_Stats.txt index 1e3e016a..84cfe555 100644 --- a/HMI/n2t-out/nspanel_Stats.txt +++ b/HMI/n2t-out/nspanel_Stats.txt @@ -34,6 +34,10 @@ pageTest 14 Component(s) 14 Line(s) of event code 14 Unique line(s) of event code +cardGrid + 39 Component(s) + 397 Line(s) of event code + 219 Unique line(s) of event code cardAlarm 28 Component(s) 159 Line(s) of event code @@ -54,13 +58,9 @@ cardThermo 42 Component(s) 450 Line(s) of event code 221 Unique line(s) of event code -cardGrid - 38 Component(s) - 419 Line(s) of event code - 221 Unique line(s) of event code Total 14 Page(s) - 341 Component(s) - 3107 Line(s) of event code - 758 Unique line(s) of event code + 342 Component(s) + 3085 Line(s) of event code + 764 Unique line(s) of event code From 0809443b5d17e9d98c74654f0b33d6b684f37793 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 20 Mar 2022 01:15:40 +0100 Subject: [PATCH 2/3] Update nspanel-lovelace-ui.py --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index e3a0297f..880cb07e 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -295,7 +295,7 @@ class NsPanelLovelaceUI: self.api.log(f"Got state_callback from {entity}", level="DEBUG") - if page_type == "cardEntities": + if page_type IN ["cardEntities", "cardGrid"]: items = current_page_config["items"] if entity in items: self.api.log(f"State change on current page for {entity}", level="DEBUG") From 6a9b4d4f0e64f87dd2b6358837b159ed1c90bcd4 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sun, 20 Mar 2022 01:16:48 +0100 Subject: [PATCH 3/3] Update nspanel-lovelace-ui.py --- apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py index 880cb07e..7bdacc40 100644 --- a/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py +++ b/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py @@ -295,7 +295,7 @@ class NsPanelLovelaceUI: self.api.log(f"Got state_callback from {entity}", level="DEBUG") - if page_type IN ["cardEntities", "cardGrid"]: + if page_type in ["cardEntities", "cardGrid"]: items = current_page_config["items"] if entity in items: self.api.log(f"State change on current page for {entity}", level="DEBUG")