esphome / esphome-webserver

A Lit Element web component frontend for the ESPHome web_server.
https://esphome.io/components/web_server
MIT License
37 stars 47 forks source link

Only allow `DETAIL_ALL` events to be added into the entity list #126

Open RFDarter opened 2 months ago

RFDarter commented 2 months ago

Allows a entity to be added to the list only if the state event is a DETAIL_ALL event. If we receive more than five DETAIL_STATE state events from the same component and never got a DETAIL_ALL event we fetch the DETAIL_ALL json from the esp.

fixes #125 needs https://github.com/esphome/esphome/pull/7531 to be merged first!

esphome:
  name: sorting-glitch

esp32:
  board: esp32dev
#   framework:
#     type: esp-idf

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

logger:
  level: ERROR

web_server:
  port: 80
  version: 3

button:
  - platform: template
    name: "My Button"
    on_press:
      - logger.log: Button Pressed

  - platform: template
    name: "My-Button-2"
    on_press:
      - logger.log: Button Pressed

datetime:
  - platform: template
    id: my_datetime_date
    type: date
    name: My ate
    optimistic: yes
    initial_value: "2024-01-30"
    restore_value: true

  - platform: template
    id: my_datetime_time
    type: time
    name: My Time
    optimistic: yes
    initial_value: "12:34:56"
    restore_value: true

  - platform: template
    id: my_datetime
    type: datetime
    name: My DateTime
    optimistic: yes
    initial_value: "2024-12-31 12:34:56"
    restore_value: true

select:
  - platform: template
    name: "Template select"
    optimistic: true
    options:
      - one
      - two
      - three
    initial_option: two

number:
  - platform: template
    name: 1
    id: number1
    optimistic: true
    min_value: 50
    max_value: 500
    step: 1
    # web_server_sorting_weight: 1
  - platform: template
    name: 2
    id: number2
    optimistic: true
    min_value: 50
    max_value: 500
    step: 1
    # web_server_sorting_weight: 2
  - platform: template
    name: 3
    id: number3
    optimistic: true
    min_value: 50
    max_value: 500
    step: 1
    # web_server_sorting_weight: 3
  - platform: template
    name: 4
    id: number4
    optimistic: true
    min_value: 50
    max_value: 500
    step: 1
    # web_server_sorting_weight: 4
  - platform: template
    name: 5
    id: number5
    optimistic: true
    min_value: 50
    max_value: 500
    step: 1
    # web_server_sorting_weight: 5

interval:
  - interval: 30ms
    then:
      - lambda: |-
          auto call = id(number1)->make_call();
          call.number_increment(true);
          call.perform();
  - interval: 20ms
    then:
      - lambda: |-
          auto call = id(number2)->make_call();
          call.number_increment(true);
          call.perform();
  - interval: 300ms
    then:
      - lambda: |-
          auto call = id(number3)->make_call();
          call.number_increment(true);
          call.perform();
  - interval: 300ms
    then:
      - lambda: |-
          auto call = id(number4)->make_call();
          call.number_increment(true);
          call.perform();
  - interval: 300ms
    then:
      - lambda: |-
          auto call = id(number5)->make_call();
          call.number_increment(true);
          call.perform();
netlify[bot] commented 2 months ago

Deploy Preview for esphome-webserver ready!

Name Link
Latest commit b92c89de78d964b955e48ad853d847e4423ed14a
Latest deploy log https://app.netlify.com/sites/esphome-webserver/deploys/674b0e3354264f00086cd4b2
Deploy Preview https://deploy-preview-126--esphome-webserver.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.