Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

RFDarter
Copy link
Collaborator

@RFDarter RFDarter commented Oct 1, 2024

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
esphome/esphome#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();

Copy link

netlify bot commented Oct 1, 2024

Deploy Preview for esphome-webserver ready!

Name Link
🔨 Latest commit b92c89d
🔍 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.

@RFDarter RFDarter marked this pull request as draft October 1, 2024 22:59
@RFDarter RFDarter changed the title Seperate init event for entitys Only alow DETAIL_ALL events to be added into the entity list Oct 3, 2024
@RFDarter RFDarter marked this pull request as ready for review October 3, 2024 00:34
@RFDarter RFDarter marked this pull request as draft October 3, 2024 00:54
@RFDarter RFDarter changed the title Only alow DETAIL_ALL events to be added into the entity list Only allow DETAIL_ALL events to be added into the entity list Oct 3, 2024
@RFDarter RFDarter marked this pull request as ready for review October 13, 2024 23:20
@jesserockz jesserockz merged commit 6cb0eaa into esphome:dev Dec 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v3 - Sometimes sorting order gets mixed up on page reload
2 participants