!include - überall möglich? Thema ist als GELÖST markiert

Bereich rings rum zum Thema Yaml und seine Tücken.


Antworten
Benutzeravatar
PX80
Beiträge: 583
Registriert: Do 21. Okt 2021, 13:09
2
Has thanked: 61 times
Been thanked: 16 times

!include - überall möglich?

Beitrag von PX80 »

Ich versuche mich gerade am Dashboard Beispiel von Matt

https://github.com/matt8707/hass-config ... elace.yaml

Er verwendet eine custom:button card und bei hold_action soll der content aus einer include datei gelesen werden

Code: Alles auswählen

          - type: custom:button-card
            entity: media_player.sony_bravia_tv
            name: Tv
            state_display: >
              [[[
                if (variables.state === 'playing') {
                  return 'På';
                }
                if (variables.state === true) {
                  return variables.translate_unknown;
                }
              ]]]
            hold_action:
              !include popup/vardagsrum_tv.yaml
Leider moniert mein Editor dies mit:

Code: Alles auswählen

YAML kann nicht geparsed werden: YAMLException: unknown tag !<!include> (115:44) 112 | ... return variables.translate_unknown; 113 | ... } 114 | ... ]]] 115 | ... old_action: !include test.yaml ------------------------------------------^ 116 | ... emplate: 117 | ... - base
Jemand eine Idee?

Zusatz: Kann !include überall im code verwendet werden?`

Danke & Gruss
PX80
Benutzeravatar
PX80
Beiträge: 583
Registriert: Do 21. Okt 2021, 13:09
2
Has thanked: 61 times
Been thanked: 16 times

Re: !include - überall möglich?

Beitrag von PX80 »

Man muss in den YAML Mode wechseln. Ich werd mich an die FAQ halten: https://www.home-assistant.io/dashboards/dashboards/
Antworten