question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicates appear with "unique: true" in case of CSS-styling (card-mod)

See original GitHub issue

I have duplicates in my auto-entities list in case of using card-mod.

Here is a small example:

  1. Without card-mod: Here we have a list of sensor.battery_* entities, and two of them are placed on the top of the list (i.e. “static elements”):
type: 'custom:auto-entities'
card:
  type: entities
  title: example
entities:
  - type: section
    label: static elements
  - entity: sensor.battery_cleargrass_2
  - entity: sensor.battery_life360_papa
  - type: section
    label: auto elements
unique: true
show_empty: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.battery_*
      options:
        secondary_info: last-changed
      sort:
        method: state
        reverse: false
        ignore_case: false
        attribute: null
        first: 0
        count: 1000
        numeric: true

изображение

  1. Now let’s apply style to the 1st static element:
type: 'custom:auto-entities'
card:
  type: entities
  title: example
entities:
  - type: section
    label: static elements
  - entity: sensor.battery_cleargrass_2
    style: |
      :host {
        color: red;
      }
  - entity: sensor.battery_life360_papa
  - type: section
    label: auto elements
unique: true
show_empty: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.battery_*
      options:
        secondary_info: last-changed
      sort:
        method: state
        reverse: false
        ignore_case: false
        attribute: null
        first: 0
        count: 1000
        numeric: true

Great, the style works fine! But now we have a duplicate: изображение

Is it a bug?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ildar170975commented, May 18, 2021

Great job! Three cases, seems to be SOLVED.

  1. Case #1 - “unique: entity”:
type: 'custom:auto-entities'
card:
  type: entities
  title: Проблема 146
entities:
  - type: section
    label: static elements
  - entity: sensor.battery_cleargrass_2
  - entity: sensor.battery_life360_papa
  - type: section
    label: auto elements
unique: entity
show_empty: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.battery_*
      options:
        secondary_info: last-changed

image

Case #2 - “unique: true”:

type: 'custom:auto-entities'
card:
  type: entities
  title: Проблема 146
entities:
  - type: section
    label: static elements
  - entity: sensor.battery_cleargrass_2
  - entity: sensor.battery_life360_papa
  - type: section
    label: auto elements
unique: true
show_empty: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.battery_*

image

Case #3 - “unique: entity”:

type: 'custom:auto-entities'
card:
  type: entities
  title: Проблема 146
entities:
  - type: section
    label: static elements
  - entity: sensor.battery_cleargrass_2
    style: |
      :host {
        color: red;
      }
  - entity: sensor.battery_life360_papa
  - type: section
    label: auto elements
unique: entity
show_empty: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.battery_*

image

1reaction
thomaslovencommented, Nov 30, 2020

Ok. That’s a bug. I’ll take a look at it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Power sensors not included with state: "> 0" · Issue #1 - GitHub
If I remove the include->state line, all the entities shows up, but I only want the entities with values greater than 0.0 to...
Read more >
[#30716] - [4.0] Cassiopeia - update card mod chrome
In this case drone failed. The "Details" link brings you to a page where on the left hand side is a list of...
Read more >
https://tagpacker.com/api/users/5931d58f3a93f114a8...
In this tutorial, we will cover how to use Varnish Cache 4.0 to improve the ... are a number of issues that are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found