amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
127 stars 24 forks source link

[BUG] hide_on_click stopped working after version 1.22.1 #108

Closed Floix closed 1 year ago

Floix commented 1 year ago

Describe the bug The hide_on_click setting is not working anymore since version 1.22.1

To Reproduce Steps to reproduce the behavior: Simple garbage collection setting:

 type: custom:garbage-collection-card
 entity: sensor.garbage_waste
 icon_size: 35px
 due_color: '#ff5e04'
 due_1_color: '#ff5e04'
 icon_color: '#5e5a5a'
 hide_date: false
 hide_on_click: true

hide_on_click is set to true (even though that's default), but no matter how ofter I click on due day or day before --> it won't hide anymore.

Expected behavior Garbage card hidden.

Screenshots Example image, click on second card, no reaction

Environment (please complete the following information):

Additional context

amaximus commented 1 year ago

Trying to reproduce the fault, the card hid on click for me. Please make sure you are not using 'Verbose State' set to true for the garbage sensors as when it's true the sensor state is not a value between 0-2 (0: today, 1: tomorrow, 2: otherwise) but a string to display thus the card cannot decide if the due daye is today, tomorrow or otherwise.

Floix commented 1 year ago

First of all, thanks for checking. I don't think the sensor is in verbose state. This is the current state from the state check in the developer tools:

days: 0
last_collection: '2023-01-30T20:03:22.469378+01:00'
last_updated: '2023-03-14T00:00:04.573195+01:00'
next_date: '2023-03-14T00:00:00+01:00'
device_class: garbage_collection__schedule
icon: mdi:biohazard
friendly_name: Biomüll
amaximus commented 1 year ago

These are the attributes of the sensor, but what is the state of the sensor?

Floix commented 1 year ago

Sorry about the confusion. The state is 0 (due today).

Floix commented 1 year ago

Is there anything I could do to help you reproduce the issue or provide you with logs? Latest update 1.23.0 didn't change anything.

amaximus commented 1 year ago

I managed to reproduce it, I'm investigating the issue. I'll keep you posted.

amaximus commented 1 year ago

I just pushed a bugfix release addressing the hide_on_click issue.

Please update the card and get back to me with results.

Floix commented 1 year ago

Works again. Thank you for this fast fix!