Skip to content

Commit

Permalink
Introduces nextion_queue_reset
Browse files Browse the repository at this point in the history
To prevent the queue growing to infinite.
  • Loading branch information
edwardtfn committed Oct 16, 2024
1 parent 9183036 commit 13e7cb2
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions esphome/nspanel_esphome_core_hw_display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ globals:
initial_value: "'.'"

- id: nextion_queue
type: uint32_t
type: uint8_t
restore_value: false
initial_value: '0'

Expand Down Expand Up @@ -544,6 +544,8 @@ script:
then:
- lambda: |-
id(nextion_queue)++;
if (id(nextion_queue) > 128)
nextion_queue_reset->execute();
- id: nextion_queue_del
mode: queued
Expand All @@ -552,18 +554,24 @@ script:
if (id(nextion_queue) > 0)
id(nextion_queue)--;
- id: nextion_queue_reset
mode: restart
then:
- lambda: |-
set_component_font->stop();
set_component_font_color->stop();
set_component_pic->stop();
set_component_text->stop();
set_component_value->stop();
set_component_visibility->stop();
id(nextion_queue) = 0;
- id: page_changed
mode: restart
then:
- lambda: |-
if (current_page->state != id(last_page)) { // Clear the buffer when a new page opens
set_component_font->stop();
set_component_font_color->stop();
set_component_pic->stop();
set_component_text->stop();
set_component_value->stop();
set_component_visibility->stop();
}
if (current_page->state != id(last_page)) // Clear the buffer when a new page opens
nextion_queue_reset->execute();
if (
current_page->state != "alarm" and
current_page->state != "climate" and
Expand Down

0 comments on commit 13e7cb2

Please sign in to comment.