diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index ea7af93..7942f55 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -988,18 +988,6 @@ display: break; } break; - case 1: // Home - switch (component_id) { - case 4: // indr_temp - case 27: // indr_temp_icon - if (id(is_climate) and !touch_event) { // Release - detailed_entity->publish_state((id(is_embedded_thermostat)) ? "embedded_climate" : ""); - disp1->set_component_value("climate.embedded", id(is_embedded_thermostat) ? 1 : 0); - goto_page->execute("climate"); - } - break; - } - break; case 8: // Settings switch (component_id) { case 9: // Reboot button @@ -1903,7 +1891,15 @@ text_sensor: esphome::api::CustomAPIDevice ha_event; // Send event to Home Assistant if (event == "short_click" or event == "long_click") { - ha_button->execute(page.c_str(), component.c_str(), event.c_str()); + if (api_server->is_connected() and page == "home" and component == "weather") { + goto_page->execute("weather01"); + } else if (id(is_climate) and page == "home" and (component == "indr_temp" or component == "indr_temp_icon")) { + detailed_entity->publish_state((id(is_embedded_thermostat)) ? "embedded_climate" : ""); + disp1->set_component_value("climate.embedded", id(is_embedded_thermostat) ? 1 : 0); + goto_page->execute("climate"); + } else { + ha_button->execute(page.c_str(), component.c_str(), event.c_str()); + } } else if (page == "light" or page == "climate") { // Generic event ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", { {"device_name", device_name->state.c_str()}, @@ -2374,10 +2370,7 @@ script: parameters: page: string then: - - lambda: |- - if (current_page->state != page) { - disp1->goto_page(page.c_str()); - } + - lambda: if (current_page->state != page) disp1->goto_page(page.c_str()); - id: ha_button mode: parallel diff --git a/hmi/dev/nspanel_eu_code/home.txt b/hmi/dev/nspanel_eu_code/home.txt index 0baf686..f32c180 100644 --- a/hmi/dev/nspanel_eu_code/home.txt +++ b/hmi/dev/nspanel_eu_code/home.txt @@ -83,6 +83,24 @@ Text indr_temp Text : Max. Text Size : 8 + Events + Touch Press Event + click_comp.txt="indr_temp" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text outdoor_temp Attributes ID : 5 @@ -317,6 +335,24 @@ Text indr_temp_icon Text : Max. Text Size : 3 + Events + Touch Press Event + click_comp.txt="indr_temp_icon" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text bt_notific Attributes ID : 28 @@ -659,9 +695,20 @@ Picture weather Events Touch Press Event - if(api==1) + click_comp.txt="indr_temp_icon" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) { - page weather01 + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF } Timer swipestore diff --git a/hmi/dev/nspanel_us_code/home.txt b/hmi/dev/nspanel_us_code/home.txt index 63d7d88..5644654 100644 --- a/hmi/dev/nspanel_us_code/home.txt +++ b/hmi/dev/nspanel_us_code/home.txt @@ -83,6 +83,24 @@ Text indr_temp Text : Max. Text Size : 8 + Events + Touch Press Event + click_comp.txt="indr_temp" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text outdoor_temp Attributes ID : 5 @@ -317,6 +335,24 @@ Text indr_temp_icon Text : Max. Text Size : 3 + Events + Touch Press Event + click_comp.txt="indr_temp_icon" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text bt_notific Attributes ID : 28 @@ -659,9 +695,20 @@ Picture weather Events Touch Press Event - if(api==1) + click_comp.txt="weather" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) { - page weather01 + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF } Timer swipestore diff --git a/hmi/dev/nspanel_us_land_code/home.txt b/hmi/dev/nspanel_us_land_code/home.txt index 0baf686..f32c180 100644 --- a/hmi/dev/nspanel_us_land_code/home.txt +++ b/hmi/dev/nspanel_us_land_code/home.txt @@ -83,6 +83,24 @@ Text indr_temp Text : Max. Text Size : 8 + Events + Touch Press Event + click_comp.txt="indr_temp" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text outdoor_temp Attributes ID : 5 @@ -317,6 +335,24 @@ Text indr_temp_icon Text : Max. Text Size : 3 + Events + Touch Press Event + click_comp.txt="indr_temp_icon" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) + { + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF + } + Text bt_notific Attributes ID : 28 @@ -659,9 +695,20 @@ Picture weather Events Touch Press Event - if(api==1) + click_comp.txt="indr_temp_icon" + click_timer.en=1 + + Touch Release Event + if(click_timer.en==1) { - page weather01 + click_timer.en=0 + lastclick.txt="{\"page\": \"home\", \"event\": \"short_click\", \"component\": \""+click_comp.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints lastclick.txt,0 + printh 00 + printh FF FF FF } Timer swipestore diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index 42a4b2a..8265bd6 100644 Binary files a/hmi/nspanel_eu.HMI and b/hmi/nspanel_eu.HMI differ diff --git a/hmi/nspanel_eu.tft b/hmi/nspanel_eu.tft index c9b3fd3..c0c588c 100644 Binary files a/hmi/nspanel_eu.tft and b/hmi/nspanel_eu.tft differ diff --git a/hmi/nspanel_us.HMI b/hmi/nspanel_us.HMI index 9d1f3f5..bc69bdd 100644 Binary files a/hmi/nspanel_us.HMI and b/hmi/nspanel_us.HMI differ diff --git a/hmi/nspanel_us.tft b/hmi/nspanel_us.tft index 3a57f3d..6f7b57c 100644 Binary files a/hmi/nspanel_us.tft and b/hmi/nspanel_us.tft differ diff --git a/hmi/nspanel_us_land.HMI b/hmi/nspanel_us_land.HMI index 4b476ad..6f8c933 100644 Binary files a/hmi/nspanel_us_land.HMI and b/hmi/nspanel_us_land.HMI differ diff --git a/hmi/nspanel_us_land.tft b/hmi/nspanel_us_land.tft index 0330484..d366a11 100644 Binary files a/hmi/nspanel_us_land.tft and b/hmi/nspanel_us_land.tft differ