diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 7907c3e..f5ac39c 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -609,12 +609,15 @@ binary_sensor: condition: api.connected: then: + - lambda: id(disp1).set_component_value("home.api",1); - lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A8"); - lambda: id(disp1).set_component_font_color("home.wifi_icon", 33808); else: + - lambda: id(disp1).set_component_value("home.api",0); - lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000F256"); - lambda: id(disp1).set_component_font_color("home.wifi_icon", 63488); else: + - lambda: id(disp1).set_component_value("home.api",0); - lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A9"); - lambda: id(disp1).set_component_font_color("home.wifi_icon", 63488); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index ca98a80..cea775c 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 13057c1..c3dfcd6 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/notification.txt b/nspanel_eu_code/notification.txt index 8ce367b..c3bf257 100644 --- a/nspanel_eu_code/notification.txt +++ b/nspanel_eu_code/notification.txt @@ -13,12 +13,18 @@ Page notification Events Preinitialize Event dim=home.brightness.val - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_eu_code/qrcode.txt b/nspanel_eu_code/qrcode.txt index 47a3d93..12ecdfb 100644 --- a/nspanel_eu_code/qrcode.txt +++ b/nspanel_eu_code/qrcode.txt @@ -13,12 +13,18 @@ Page qrcode Events Preinitialize Event dim=home.brightness.val - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_eu_code/screensaver.txt b/nspanel_eu_code/screensaver.txt index 5c7168e..d53450d 100644 --- a/nspanel_eu_code/screensaver.txt +++ b/nspanel_eu_code/screensaver.txt @@ -21,7 +21,7 @@ Page screensaver printh FF FF FF Touch Release Event - page home + page orign.val Variable (int32) orign Attributes diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 83c26df..c09d0c8 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index d090965..9f510dd 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/cover.txt b/nspanel_us_code/cover.txt index 10246df..5e930e7 100644 --- a/nspanel_us_code/cover.txt +++ b/nspanel_us_code/cover.txt @@ -13,14 +13,20 @@ Page cover Events Preinitialize Event dim=home.brightness.val - coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}" - printh 92 - prints "nspanelevent",0 - printh 00 - prints coversetting.txt,0 - printh 00 - printh FF FF FF - page_label.txt=home.entity.txt + if(home.api.val==0) + { + page home + }else + { + coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints coversetting.txt,0 + printh 00 + printh FF FF FF + page_label.txt=home.entity.txt + } Touch Press Event coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}" diff --git a/nspanel_us_code/entitypage01.txt b/nspanel_us_code/entitypage01.txt index 0dae56e..864e3f1 100644 --- a/nspanel_us_code/entitypage01.txt +++ b/nspanel_us_code/entitypage01.txt @@ -12,12 +12,19 @@ Page entitypage01 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"entitypage01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"entitypage01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/light.txt b/nspanel_us_code/light.txt index 300a31c..b2c8af9 100644 --- a/nspanel_us_code/light.txt +++ b/nspanel_us_code/light.txt @@ -13,32 +13,38 @@ Page light Events Preinitialize Event dim=home.brightness.val - lightsetting.txt="{\"page\": \"light\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}" - printh 92 - prints "nspanelevent",0 - printh 00 - prints lightsetting.txt,0 - printh 00 - printh FF FF FF - vis light_b_press,1 - vis lightslider,1 - vis light_value,1 - // #### OFF Button ##### - vis temp_b_press,0 - vis color_b_pres,0 - // #### OFF Value ##### - vis temp_value,0 - vis light_value_2,0 - // #### OFF Slider ##### - vis tempslider,0 - vis colorwheel,0 - // #### Hide color & temp buttons ##### - vis temp_touch,0 - vis temp_value_2,0 - vis temp_button,0 - vis color_touch,0 - vis color_button,0 - page_label.txt=home.entity.txt + if(home.api.val==0) + { + page home + }else + { + lightsetting.txt="{\"page\": \"light\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints lightsetting.txt,0 + printh 00 + printh FF FF FF + vis light_b_press,1 + vis lightslider,1 + vis light_value,1 + // #### OFF Button ##### + vis temp_b_press,0 + vis color_b_pres,0 + // #### OFF Value ##### + vis temp_value,0 + vis light_value_2,0 + // #### OFF Slider ##### + vis tempslider,0 + vis colorwheel,0 + // #### Hide color & temp buttons ##### + vis temp_touch,0 + vis temp_value_2,0 + vis temp_button,0 + vis color_touch,0 + vis color_button,0 + page_label.txt=home.entity.txt + } Touch Press Event lightsetting.txt="{\"page\": \"light\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}" diff --git a/nspanel_us_code/notification.txt b/nspanel_us_code/notification.txt index 8cf3e6b..85f9742 100644 --- a/nspanel_us_code/notification.txt +++ b/nspanel_us_code/notification.txt @@ -13,12 +13,18 @@ Page notification Events Preinitialize Event dim=home.brightness.val - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/qrcode.txt b/nspanel_us_code/qrcode.txt index 47a3d93..12ecdfb 100644 --- a/nspanel_us_code/qrcode.txt +++ b/nspanel_us_code/qrcode.txt @@ -13,12 +13,18 @@ Page qrcode Events Preinitialize Event dim=home.brightness.val - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/screensaver.txt b/nspanel_us_code/screensaver.txt index 0f8c5fd..d53450d 100644 --- a/nspanel_us_code/screensaver.txt +++ b/nspanel_us_code/screensaver.txt @@ -20,6 +20,9 @@ Page screensaver printh 00 printh FF FF FF + Touch Release Event + page orign.val + Variable (int32) orign Attributes ID : 2 diff --git a/nspanel_us_code/weather01.txt b/nspanel_us_code/weather01.txt index d72d1a8..7161474 100644 --- a/nspanel_us_code/weather01.txt +++ b/nspanel_us_code/weather01.txt @@ -12,12 +12,19 @@ Page weather01 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"weather01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"weather01\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/weather02.txt b/nspanel_us_code/weather02.txt index dfe10b4..5f34cca 100644 --- a/nspanel_us_code/weather02.txt +++ b/nspanel_us_code/weather02.txt @@ -12,12 +12,19 @@ Page weather02 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"weather02\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"weather02\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/weather03.txt b/nspanel_us_code/weather03.txt index c05f616..801cf59 100644 --- a/nspanel_us_code/weather03.txt +++ b/nspanel_us_code/weather03.txt @@ -12,12 +12,19 @@ Page weather03 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"weather03\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"weather03\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/weather04.txt b/nspanel_us_code/weather04.txt index 1def451..c097ed6 100644 --- a/nspanel_us_code/weather04.txt +++ b/nspanel_us_code/weather04.txt @@ -12,12 +12,19 @@ Page weather04 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"weather04\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"weather04\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_code/weather05.txt b/nspanel_us_code/weather05.txt index 31fa499..279047c 100644 --- a/nspanel_us_code/weather05.txt +++ b/nspanel_us_code/weather05.txt @@ -12,12 +12,19 @@ Page weather05 Events Preinitialize Event - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"weather05\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"weather05\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 3c8a5b2..64bbf7a 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index d5f2f65..db6f8cb 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/notification.txt b/nspanel_us_land_code/notification.txt new file mode 100644 index 0000000..c3bf257 --- /dev/null +++ b/nspanel_us_land_code/notification.txt @@ -0,0 +1,187 @@ +Page notification + Attributes + ID : 0 + Scope : local + Dragging : 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID: disabled + + Events + Preinitialize Event + dim=home.brightness.val + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"notification\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } + + Touch Press Event + printh 92 + prints "touchevent",0 + printh 00 + prints "{\"page\": \"notification\", \"component\": \"touchevent\", \"value\": \"press\"}",0 + printh 00 + printh FF FF FF + + Touch Release Event + printh 92 + prints "touchevent",0 + printh 00 + prints "{\"page\": \"notification\", \"component\": \"touchevent\", \"value\": \"release\"}",0 + printh 00 + printh FF FF FF + +Variable (string) lastclick + Attributes + ID : 10 + Scope : local + Text : + Max. Text Size: 100 + +Text notifi_text01 + Attributes + ID : 2 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 100 + +Text notifi_label + Attributes + ID : 3 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 30 + +Picture accept_pic + Attributes + ID : 4 + Scope : local + Dragging : 0 + Send Component ID: disabled + +Picture clear_pic + Attributes + ID : 5 + Scope : local + Dragging : 0 + Send Component ID: disabled + +Hotspot notifi_back + Attributes + ID : 1 + Scope : local + Dragging : 0 + Send Component ID: disabled + + Events + Touch Press Event + page home + +Hotspot accept + Attributes + ID : 6 + Scope : local + Dragging : 0 + Send Component ID: disabled + + Events + Touch Release Event + lastclick.txt="{\"page\": \"notification\", \"component\": \"accept\", \"value\": \"release\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Hotspot clear + Attributes + ID : 7 + Scope : local + Dragging : 0 + Send Component ID: disabled + + Events + Touch Release Event + lastclick.txt="{\"page\": \"notification\", \"component\": \"clear\", \"value\": \"release\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + +Timer swipestore + Attributes + ID : 9 + Scope : local + Period (ms): 50 + Enabled : no + + Events + Timer Event + swipex=tch0 + swipey=tch1 + +TouchCap swipe + Attributes + ID : 8 + Scope: local + Value: 0 + + Events + Touch Press Event + swipestore.en=1 // Start swipestore timer + + Touch Release Event + swipestore.en=0 + // Touch has ended, x + if(tch0==0) + { + swipec=swipex-tch2 + // From Left to Right + if(swipec>swipedx) + { + //page + } + // Right to Left + swipec2=0-swipedx + if(swipec100) + { + //page + } + // Down to Up + swipec2=0-swipedy + if(swipec<-100) + { + //page + } + } + diff --git a/nspanel_us_land_code/qrcode.txt b/nspanel_us_land_code/qrcode.txt index 47a3d93..12ecdfb 100644 --- a/nspanel_us_land_code/qrcode.txt +++ b/nspanel_us_land_code/qrcode.txt @@ -13,12 +13,18 @@ Page qrcode Events Preinitialize Event dim=home.brightness.val - printh 92 - prints "nspanelevent",0 - printh 00 - prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 - printh 00 - printh FF FF FF + if(home.api.val==0) + { + page home + }else + { + printh 92 + prints "nspanelevent",0 + printh 00 + prints "{\"page\": \"qrcode\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 + printh 00 + printh FF FF FF + } Touch Press Event printh 92 diff --git a/nspanel_us_land_code/screensaver.txt b/nspanel_us_land_code/screensaver.txt index 5c7168e..d53450d 100644 --- a/nspanel_us_land_code/screensaver.txt +++ b/nspanel_us_land_code/screensaver.txt @@ -21,7 +21,7 @@ Page screensaver printh FF FF FF Touch Release Event - page home + page orign.val Variable (int32) orign Attributes