Replace page announcement

Using "sendme" in replace to text sensor "currentpage".
This commit is contained in:
Edward Firmo
2023-11-27 20:34:40 +01:00
parent a60ad3abd3
commit 629bf0aad1
88 changed files with 104 additions and 506 deletions

View File

@@ -741,11 +741,14 @@ display:
platform: nextion
uart_id: tf_uart
start_up_page: 8
on_page: # This requires `sendme` to be executed on Nextion side
on_page:
lambda: |-
static const char *const TAG = "display.disp1.on_page";
ESP_LOGD(TAG, "Nextion page changed");
ESP_LOGD(TAG, "New page: %s (%i)" , id(page_names)[x].c_str(), x);
current_page->publish_state(id(page_names)[x].c_str());
page_changed->execute(id(page_names)[x].c_str());
on_setup:
- script.execute: boot_sequence
@@ -1392,25 +1395,25 @@ text_sensor:
##### Current page name #####
- name: ${device_name} Current page
id: current_page
#platform: template
platform: nextion
nextion_id: disp1
component_name: currentpage
platform: template
#platform: nextion
#nextion_id: disp1
#component_name: currentpage
icon: mdi:tablet-dashboard
internal: false
disabled_by_default: false
filters:
- lambda: |-
x = x.c_str();
x.shrink_to_fit();
return x;
on_value:
then:
- lambda: |-
static const char *const TAG = "text_sensor.current_page";
// Construct new page
ESP_LOGV(TAG, "Construct new page");
page_changed->execute(x.c_str());
#filters:
# - lambda: |-
# x = x.c_str();
# x.shrink_to_fit();
# return x;
#on_value:
# then:
# - lambda: |-
# static const char *const TAG = "text_sensor.current_page";
# // Construct new page
# ESP_LOGV(TAG, "Construct new page");
# page_changed->execute(x.c_str());
- name: ${device_name} Notification Label
platform: template

Binary file not shown.

Binary file not shown.

View File

@@ -17,12 +17,7 @@ Page alarm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "alarm",0
printh 00
printh FF FF FF
sendme
vis bt_home,0
vis bt_away,0
vis bt_night,0

View File

@@ -12,12 +12,7 @@ Page boot
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
sendme
dim=0
vis bt_reboot,0
covx baud,baud_rate.txt,0,0
@@ -142,7 +137,7 @@ Text tft_version
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 4.1.2
Text : 4.2dev
Max. Text Size : 9
Text esph_version

View File

@@ -17,12 +17,7 @@ Page buttonpage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage01",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage02",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage03",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage04",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -14,12 +14,7 @@ Page climate
Preinitialize Event
if(api==1||embedded.val==1)
{
printh 92
prints "currentpage",0
printh 00
prints "climate",0
printh 00
printh FF FF FF
sendme
vis target_icon,0
vis target_temp,0
vis current_temp,0

View File

@@ -17,12 +17,7 @@ Page confirm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "confirm",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page cover
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "cover",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page fan
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "fan",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page home
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "home",0
printh 00
printh FF FF FF
sendme
vis bt_notific,is_notification
vis bt_qrcode,is_qrcode
vis bt_entities,is_entities

View File

@@ -17,12 +17,7 @@ Page keyb_num
page page_id.val
}else
{
printh 92
prints "currentpage",0
printh 00
prints "keyb_num",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page light
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "light",0
printh 00
printh FF FF FF
sendme
vis light_b_press,1
vis lightslider,1
vis light_value,1

View File

@@ -17,12 +17,7 @@ Page media_player
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "media_player",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page notification
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "notification",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page qrcode
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "qrcode",0
printh 00
printh FF FF FF
sendme
Touch Press Event
printh 91

View File

@@ -12,12 +12,7 @@ Page screensaver
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "screensaver",0
printh 00
printh FF FF FF
sendme
dim=0
Touch Release Event

View File

@@ -12,12 +12,7 @@ Page settings
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "settings",0
printh 00
printh FF FF FF
sendme
covx brightslider.val,bright_text.txt,0,0
bright_text.txt+="%"
covx dimslider.val,dim_text.txt,0,0

View File

@@ -17,12 +17,7 @@ Page weather01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather05
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather05",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

Binary file not shown.

Binary file not shown.

View File

@@ -17,12 +17,7 @@ Page alarm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "alarm",0
printh 00
printh FF FF FF
sendme
vis bt_home,0
vis bt_away,0
vis bt_night,0

View File

@@ -12,12 +12,7 @@ Page boot
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
sendme
dim=0
vis bt_reboot,0
covx baud,baud_rate.txt,0,0
@@ -142,7 +137,7 @@ Text tft_version
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 4.1.2
Text : 4.2dev
Max. Text Size : 9
Text esph_version

View File

@@ -17,12 +17,7 @@ Page buttonpage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage01",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage02",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage03",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage04",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -14,12 +14,7 @@ Page climate
Preinitialize Event
if(api==1||embedded.val==1)
{
printh 92
prints "currentpage",0
printh 00
prints "climate",0
printh 00
printh FF FF FF
sendme
vis target_icon,0
vis target_temp,0
vis current_temp,0

View File

@@ -17,12 +17,7 @@ Page confirm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "confirm",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page cover
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "cover",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page fan
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "fan",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page home
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "home",0
printh 00
printh FF FF FF
sendme
vis bt_notific,is_notification
vis bt_qrcode,is_qrcode
vis bt_entities,is_entities

View File

@@ -17,12 +17,7 @@ Page keyb_num
page page_id.val
}else
{
printh 92
prints "currentpage",0
printh 00
prints "keyb_num",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page light
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "light",0
printh 00
printh FF FF FF
sendme
vis light_b_press,1
vis lightslider,1
vis light_value,1

View File

@@ -17,12 +17,7 @@ Page media_player
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "media_player",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page notification
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "notification",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page qrcode
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "qrcode",0
printh 00
printh FF FF FF
sendme
Touch Press Event
printh 91

View File

@@ -12,12 +12,7 @@ Page screensaver
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "screensaver",0
printh 00
printh FF FF FF
sendme
dim=0
Touch Release Event

View File

@@ -12,12 +12,7 @@ Page settings
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "settings",0
printh 00
printh FF FF FF
sendme
covx brightslider.val,bright_text.txt,0,0
bright_text.txt+="%"
covx dimslider.val,dim_text.txt,0,0

View File

@@ -17,12 +17,7 @@ Page weather01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather05
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather05",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

Binary file not shown.

Binary file not shown.

View File

@@ -17,12 +17,7 @@ Page alarm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "alarm",0
printh 00
printh FF FF FF
sendme
vis bt_home,0
vis bt_away,0
vis bt_night,0

View File

@@ -12,12 +12,7 @@ Page boot
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "boot",0
printh 00
printh FF FF FF
sendme
dim=0
vis bt_reboot,0
covx baud,baud_rate.txt,0,0
@@ -142,7 +137,7 @@ Text tft_version
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text : 4.1.2
Text : 4.2dev
Max. Text Size : 9
Text esph_version

View File

@@ -17,12 +17,7 @@ Page buttonpage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage01",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage02",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage03",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -17,12 +17,7 @@ Page buttonpage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "buttonpage04",0
printh 00
printh FF FF FF
sendme
vis 255,0
vis button_back,1
vis page_index,1

View File

@@ -14,12 +14,7 @@ Page climate
Preinitialize Event
if(api==1||embedded.val==1)
{
printh 92
prints "currentpage",0
printh 00
prints "climate",0
printh 00
printh FF FF FF
sendme
vis target_icon,0
vis target_temp,0
vis current_temp,0

View File

@@ -17,12 +17,7 @@ Page confirm
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "confirm",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page cover
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "cover",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page entitypage04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "entitypage04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page fan
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "fan",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page home
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "home",0
printh 00
printh FF FF FF
sendme
vis bt_notific,is_notification
vis bt_qrcode,is_qrcode
vis bt_entities,is_entities

View File

@@ -17,12 +17,7 @@ Page keyb_num
page page_id.val
}else
{
printh 92
prints "currentpage",0
printh 00
prints "keyb_num",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page light
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "light",0
printh 00
printh FF FF FF
sendme
vis light_b_press,1
vis lightslider,1
vis light_value,1

View File

@@ -17,12 +17,7 @@ Page media_player
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "media_player",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page notification
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "notification",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -12,12 +12,7 @@ Page qrcode
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "qrcode",0
printh 00
printh FF FF FF
sendme
Touch Press Event
printh 91

View File

@@ -12,12 +12,7 @@ Page screensaver
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "screensaver",0
printh 00
printh FF FF FF
sendme
dim=0
Touch Release Event

View File

@@ -12,12 +12,7 @@ Page settings
Events
Preinitialize Event
printh 92
prints "currentpage",0
printh 00
prints "settings",0
printh 00
printh FF FF FF
sendme
covx brightslider.val,bright_text.txt,0,0
bright_text.txt+="%"
covx dimslider.val,dim_text.txt,0,0

View File

@@ -17,12 +17,7 @@ Page weather01
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather01",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather02
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather02",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather03
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather03",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather04
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather04",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event

View File

@@ -17,12 +17,7 @@ Page weather05
page home
}else
{
printh 92
prints "currentpage",0
printh 00
prints "weather05",0
printh 00
printh FF FF FF
sendme
}
Touch Press Event