datetime-card
datetime-card copied to clipboard
Visual editor not working
Hi
THANKS, REALLY Great you implemented all requests 🎉
It's only a little bit hard to find the new options as the visual editor doesn't work for me.
I was able to guess friendly_name. That works great. But the other options?!
PS in the readme there is still some info that was related to my script.
And please consider to add my auto entities example. I use that now in stead of the script
Best Eric
Hi @erkr , I will update the readme with a complete configuration and remove the info related to your script.
in the meantime:
reset_forward: true # or false
show_expired_only: true # of false
for the error: cannot set read-only property 'setConfig' is it a regression? was it working before? do you have more details in the browser console? As I wrote in the readme it could be caused by other plugins
I normally populate the card using auto entities, so I didn't use the editor for several months. I only tried that to find the new options. I will look in the browser tomorrow. 👍 I'm missing one option, I was hoping for. Will make that a separate issue
New option show_expired_only works great as well, thanks 😃
I just tried to edit the card with Chrome on Windows, and this is the only error that pops up in the dev console:
I have both the layout card and the card-mod installed. So that error is to be expected
My editor looks pretty much the same as in the first post here. How am I supposed to use this card when "SAVE" button is all greyed out??
@Tee86 not possible in a normal way. Two options:
- You can edit the card via the raw config editor for the whole view. Only do that if you know how that works.
- Use auto entities to populate the card:
type: custom:auto-entities
filter:
template: |
{%- set entities=['input_datetime.cv_ketel',
'input_datetime.rooster_droger'] -%}
{%- set max_days=[365,30] -%}
{%- set ns = namespace(info=[]) -%}
{%- for entity in entities -%}
{%- set new = {
'id': entity,
'max': max_days[loop.index0] }
-%}
{%- set ns.info = ns.info + [new] -%}
{%- endfor -%}
{{ ns.info|sort(attribute='remains') }}
card:
type: custom:datetime-card
flex_direction: row
image: ""
show_names: true
title: Maintenance
Result:
I use a more advanced template to filter the entities close to expiration. But this is the basics
@a-p-z please fix this
NOTE: lovelace-card-mod and lovelace-layout-card makes the visual editor crash because it tries to overwrite setConfig method, which in datetime-card is read-only. The code editor works, just ignore the error.
The code editor works, just ignore the error.
Thanks for responding. Something has changed as the error can't be ignored anymore! When editing the card, the Save button remains disabled:
I will have a look
I have updated svelte to svelte 5 and made the setConfig NOT read-only, therefore that error should not happen anymore
Fixed,thanks
Thanks to all of you for the feedback