esphome-webserver icon indicating copy to clipboard operation
esphome-webserver copied to clipboard

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

Open RFDarter opened this issue 5 months ago • 1 comments

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 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();

RFDarter avatar Oct 01 '24 22:10 RFDarter