@@ -988,18 +988,6 @@ display:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
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
|
case 8: // Settings
|
||||||
switch (component_id) {
|
switch (component_id) {
|
||||||
case 9: // Reboot button
|
case 9: // Reboot button
|
||||||
@@ -1903,7 +1891,15 @@ text_sensor:
|
|||||||
esphome::api::CustomAPIDevice ha_event;
|
esphome::api::CustomAPIDevice ha_event;
|
||||||
// Send event to Home Assistant
|
// Send event to Home Assistant
|
||||||
if (event == "short_click" or event == "long_click") {
|
if (event == "short_click" or event == "long_click") {
|
||||||
|
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());
|
ha_button->execute(page.c_str(), component.c_str(), event.c_str());
|
||||||
|
}
|
||||||
} else if (page == "light" or page == "climate") { // Generic event
|
} else if (page == "light" or page == "climate") { // Generic event
|
||||||
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
|
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
|
||||||
{"device_name", device_name->state.c_str()},
|
{"device_name", device_name->state.c_str()},
|
||||||
@@ -2374,10 +2370,7 @@ script:
|
|||||||
parameters:
|
parameters:
|
||||||
page: string
|
page: string
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: if (current_page->state != page) disp1->goto_page(page.c_str());
|
||||||
if (current_page->state != page) {
|
|
||||||
disp1->goto_page(page.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
- id: ha_button
|
- id: ha_button
|
||||||
mode: parallel
|
mode: parallel
|
||||||
|
|||||||
@@ -83,6 +83,24 @@ Text indr_temp
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 8
|
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
|
Text outdoor_temp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
ID : 5
|
||||||
@@ -317,6 +335,24 @@ Text indr_temp_icon
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 3
|
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
|
Text bt_notific
|
||||||
Attributes
|
Attributes
|
||||||
ID : 28
|
ID : 28
|
||||||
@@ -659,9 +695,20 @@ Picture weather
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
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
|
Timer swipestore
|
||||||
|
|||||||
@@ -83,6 +83,24 @@ Text indr_temp
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 8
|
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
|
Text outdoor_temp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
ID : 5
|
||||||
@@ -317,6 +335,24 @@ Text indr_temp_icon
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 3
|
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
|
Text bt_notific
|
||||||
Attributes
|
Attributes
|
||||||
ID : 28
|
ID : 28
|
||||||
@@ -659,9 +695,20 @@ Picture weather
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
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
|
Timer swipestore
|
||||||
|
|||||||
@@ -83,6 +83,24 @@ Text indr_temp
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 8
|
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
|
Text outdoor_temp
|
||||||
Attributes
|
Attributes
|
||||||
ID : 5
|
ID : 5
|
||||||
@@ -317,6 +335,24 @@ Text indr_temp_icon
|
|||||||
Text :
|
Text :
|
||||||
Max. Text Size : 3
|
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
|
Text bt_notific
|
||||||
Attributes
|
Attributes
|
||||||
ID : 28
|
ID : 28
|
||||||
@@ -659,9 +695,20 @@ Picture weather
|
|||||||
|
|
||||||
Events
|
Events
|
||||||
Touch Press Event
|
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
|
Timer swipestore
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user