UI icon indicating copy to clipboard operation
UI copied to clipboard

YAMLException when using CodeGenerator for installation (UI-mode)

Open LOKOH1 opened this issue 3 years ago • 2 comments

Hi, I am a complete newby and I hope this is a real issue and not my incompetence. If it is, I want to apologize in advance.

When I paste the generated template Code into the Raw Config editor of the dashboard and try to save it, I get this error message:

YAML kann nicht geparsed werden: YAMLException: bad indentation of a sequence entry (642:9) 639 | var label = states[entity ... 640 | } 641 | return label; 642 | ]]] ---------------^ 643 | 644 | card_media_player_with_control:

grafik

I am pretty sure I followed the instructions correctly. I used HACS to install the Cards. But what I noticed was, that the names of some Cards changed, since you wrote the instructions. But I am 95% sure that I have found the correct repositories. This is the content from line 630 to 650:

  ]]]
state:
  - operator: template
    value: "[[[ return entity.state != 'off' ]]]"
    name: "[[[ return states[entity.entity_id].attributes.media_title; ]]]"
    label: |
      [[[ 
        var label = variables.ulm_on;
        if(states[entity.entity_id].attributes.media_album_name){
          var label = states[entity.entity_id].attributes.media_album_name;
        }
        return label;
    ]]]

card_media_player_with_control: template: - icon_info_bg - ulm_language_variables icon: | [[[ var icon = 'mdi:speaker';

Thank you very much in advance for helping me with my problem!

LOKOH1 avatar Dec 22 '21 13:12 LOKOH1

Please also have a look here: https://github.com/UI-Lovelace-Minimalist/UI/discussions/100#discussioncomment-1857208 The wiki page and the related code generator are currently outdated to a large extent, as we currently have no access to it and the owner @Paddy0174 of the organization / wiki page repos is not reachable atm 😞

But I will keep your bug report open until we can fix the problem.

CM000n avatar Dec 22 '21 15:12 CM000n

Same issue here but figured out that on line 642 u need to put space in front of " ]", Problem is that after that I get:

Unable to parse YAML: YAMLException: end of the stream or a document separator is expected (1573:1) 1570 | ulm_custom_card_paddy_we ... 1571 | ulm_custom_card_paddy_we ... 1572 | ulm_custom_card_paddy_we ... 1573 | - title: Home --------^ 1574 | cards: []

yaml

JerryCih avatar Jan 12 '22 10:01 JerryCih

  ]]]
state:
  - operator: template
    value: "[[[ return entity.state != 'off' ]]]"
    name: "[[[ return states[entity.entity_id].attributes.media_title; ]]]"
    label: |
      [[[ 
        var label = variables.ulm_on;
        if(states[entity.entity_id].attributes.media_album_name){
          var label = states[entity.entity_id].attributes.media_album_name;
        }
        return label;
    ]]]

card_media_player_with_control: template:

  • icon_info_bg
  • ulm_language_variables icon: | [[[ var icon = 'mdi:speaker';

From what I understand this issue has since been resolved. Is there any way that the generator can be patched?

LookedPath avatar Dec 23 '22 08:12 LookedPath