datetime-card icon indicating copy to clipboard operation
datetime-card copied to clipboard

Visual editor not working

Open erkr opened this issue 1 year ago • 4 comments

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. image

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

erkr avatar Apr 13 '24 21:04 erkr

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

a-p-z avatar Apr 14 '24 10:04 a-p-z

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

erkr avatar Apr 14 '24 10:04 erkr

New option show_expired_only works great as well, thanks 😃

erkr avatar Apr 14 '24 12:04 erkr

I just tried to edit the card with Chrome on Windows, and this is the only error that pops up in the dev console: image I have both the layout card and the card-mod installed. So that error is to be expected

erkr avatar Apr 15 '24 09:04 erkr

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 avatar Dec 11 '24 13:12 Tee86

@Tee86 not possible in a normal way. Two options:

  1. You can edit the card via the raw config editor for the whole view. Only do that if you know how that works.
  2. 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: image

I use a more advanced template to filter the entities close to expiration. But this is the basics

@a-p-z please fix this

erkr avatar Dec 11 '24 13:12 erkr

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.

a-p-z avatar Dec 18 '24 19:12 a-p-z

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: image

erkr avatar Dec 19 '24 09:12 erkr

I will have a look

a-p-z avatar Dec 21 '24 00:12 a-p-z

I have updated svelte to svelte 5 and made the setConfig NOT read-only, therefore that error should not happen anymore

a-p-z avatar Dec 27 '24 18:12 a-p-z

Fixed,thanks

erkr avatar Dec 27 '24 23:12 erkr

Thanks to all of you for the feedback

a-p-z avatar Dec 28 '24 10:12 a-p-z