esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

Hidden / Internal Display Pages #1565

Open LewisSpring opened 2 years ago

LewisSpring commented 2 years ago

Describe the problem you have/What new integration you would like

Add a flag for pages to become hidden/internal. This means that they cannot be reached via next/prev page commands. Instead, they have to be directly accessed by display.page.show.

Please describe your use case for this integration and alternatives you've tried:

This would allow for pages for certain events to appear, eg, a doorbell press, but not appear during a idle carousel.

  1. Doorbell triggers: A trigger Sets template switch PauseCarousel to ON
  2. Next Page Loop (Carousel) "pauses" via If Statement (If PauseCarousel is True, the next page loop does not change pages)
  3. The event page (Doorbell Press) is switched to.
  4. There is a delay, then the Next Page loop continues as the PauseCarousel is set to OFF.
switch:
  - platform: template
    id: PauseCarousel

binary_sensor:
  - platform: homeassistant
    id: doorbell
    entity_id: sensor.doorbell_ding
    on_press:
      - switch.turn_on: PauseCarousel
      - display.page.show: doorbell_ding
      - delay: 15s
      - switch.turn_off PauseCarousel

interval:
  - interval: 30s
    then:
      - if:
          condition:
            - switch.is_off: pauseCarousel
          then:
            - display.page.show_next: my_display
            - component.update: my_display

Alternative

  on_loop:
    then:
      -  display.page.show: page1
      - delay: 30s
      - display.page.show: page2
...

Additional context

This could also be used for temporary previews in between a carousel, eg, a button that switches to a hidden page until the next page turn.

nielsnl68 commented 2 years ago

Sounds nice. I will see what i can do on this. For the switchplate i working on i added this option already.