royto / logbook-card

Logbook card for Home Assistant UI Lovelace
GNU General Public License v3.0
204 stars 9 forks source link

entity_picture is processed differently than in the stock Logbook #131

Closed ildar170975 closed 4 months ago

ildar170975 commented 4 months ago

This is NOT a bug report or a FR - this is mainly a question.

Since some HA version (probably 2022.6) there is no way to see a REAL entity_picture in a stock Logbook. Instead, all records show an entity_picture from the latest state. See a related issue - https://github.com/home-assistant/frontend/issues/21470. And we get this: Untitled Project Here each row must be either orange or blue (alternating) - instead, they are of same color.

But the custom:logbook-card seems to process it in a right way:

type: custom:logbook-card
entity: binary_sensor.testing_logbook_sensor_with_image
history: 1

изображение

So I wonder why this custom:logbook-card works correct? )))) Does the author of this card know about this bug (or a behaviour by a design) in Frontend - and intentionally IMPROVED this behaviour in this card?

Test entities:

input_boolean:
  test_boolean:

template:
  - binary_sensor:
      - name: testing_logbook_sensor_with_image
        state: >-
          {{ states('input_boolean.test_boolean') }}
        picture: >-
          {% if is_state('input_boolean.test_boolean','on') -%}
            /local/images/test/orange.jpg
          {%- else -%}
            /local/images/test/blue.jpg
          {%- endif %}
royto commented 4 months ago

the card is using the state-badge custom element from HA

There is no specific code to fix the issue

See code here

ildar170975 commented 4 months ago

I am not proposing to "fix" the code. As I said - the logbook-card is working GREAT, and the stock Logbook is working WRONG. So I suspected may be you process entity_picture in a different way than it is done in the stock Logbook.

royto commented 4 months ago

Yes, I understand that you were not proposing to fix a bug in the card.

I was just saying that there is no workaround in the card ...

I don't know how is implemented the stock card so I don't know if there are using the same way to render icon ...

ildar170975 commented 4 months ago

I see your point. Will wait for a feedback from frontend devs (https://github.com/home-assistant/frontend/issues/21470). Unfortunately, there is a stable trend of ignoring issues both in HA core & frontend... Closing.