Closed danielbrunt57 closed 1 year ago
I think it works as expected. Could you please double-check and get back to me with results?
I don't think so. While it may be as expected it is not as I desire!
I have to have hide_date: false to see "Due Today" but if I set garbage the same way I see the date...
Basically, I would like hide_date to hide 02/07/2023
but not Due today
.
Due today
should be the same as in 6 days
and not considered as date?
Or Due Today
is displayed when days=0?
Date should just be a date and days is in 5 days
| in 2 days
| Due tomorrow
| Due today
If you want 'due today/tomorrow' instead of 'in 0/1 days' then set due_txt: true
. That will overwrite hide_date and hide_days when due day is today or tomorrow. Otherwise hide_days and hide_date manipulate what are displayed.
So you should have:
due_txt: true
hide_date: true
hide_days: false
(the last one can be left out as it's the default value.
You may check the example from: https://github.com/amaximus/garbage-collection-card/issues/103#issuecomment-1413358970
due_text only displays when true if hide_date is false...
I want to hide the date portion of "01/07/2023 in 6 days" so it says "in 6 days" and when sensor state is 0 or 1, I want it to display "Today" or "Tomorrow"...
If you want 'due today/tomorrow' instead of 'in 0/1 days' then set
due_txt: true
.
I have never seen "in 0 days" or "in 1 day". I have tried false,false,false, true,false,false, false,true,false, false,false,true, true,true,false, true,false,true, false,true,true and true,true,true!
The only way I get "in [2:6] days" is with true,true,false or false,true,false.
But when days is 0 or 1 it never says "in 0|1 day(s)".
Instead, it says either "Today|Tomorrow" or "Due Today|Due Tomorrow" but only when hide_date is false and that will reveal the date "02/07/2023" when days is 6.
due_txt only controls what it is displayed when the collection is due today or tomorrow (the sensor has a state value of 0 or 1). Otherwise it doesn't have any effect. In a setup like this:
- type: custom:garbage-collection-card
entity: sensor.test_garbage_every_tue
icon_color: green
icon_size: 35px
hide_date: true
hide_days: false
due_txt: true
details_size: 12px
hass_lang_priority: true
:
- type: custom:garbage-collection-card
entity: sensor.test_garbage_every_fri
icon_size: 35px
hide_date: true
hide_days: false
due_txt: true
due_color: blue
due_1_color: brown
- type: custom:garbage-collection-card
entity: sensor.test_garbage_every_sat
icon_size: 35px
hide_date: true
hide_days: false
due_txt: false
due_color: blue
due_1_color: brown
you get the following for Tue, Fri and Sat:
So are you saying with 1 sensor state and 1 static card configuration that I cannot achieve... "in 3 days" "in 2 days" "Tomorrow" "Today" "in 6 days" ??
Your test example is difficult to comprehend...
Please set:
hide_date: true
hide_days: false
due_txt: true
for your garbage cards and make sure you reload from server (shift-reload) the card. Please also make sure you are using the latest version of the card (1.22.4).
Those were my settings for the card. I was running 1.22.3 but no notification of update for 1.22.4. I issued a re-download in HACS and now have 1.22.4. I have manually set/override sensor state/days in Dev Tools and can confirm it is now working as I desire.
Obviously, you found an error in the logic and corrected it. Thank you!!!
I supported your efforts! https://www.buymeacoffee.com/6rF5cQl
Thanks again! -Daniel
Describe the bug Please fix the logic for
so I can see "in 6 days" or "Due Today" without it showing the date.