Picture-glace template image

hi,

is possible template the image of a picture-glace? I want change the picture when the cover is open or close. I try in this mode, but dont’work.

          - type: picture-glance
            title: Salotto
            image: >
              {% if is_state('cover.tapparella_salotto', 'open') %}
                '/local/salotto.png'
              {% if is_state('cover.tapparella_salotto', 'close') %}
                '/local/salotto.png'
            entities:
              - entity: light.lampadario_salotto
              - entity: light.lampada_salotto_2
              - entity: light.lampada_vetrinetta
              - entity: cover.tapparella_salotto
              - entity: media_player.tv_salotto
            entity: light.luci_salotto

You need this:

The templates are JavaScript not jinja.

thanks

              - type: 'custom:config-template-card'
                variables:
                  - states['cover.tapparella_salotto'].state
                entities:
                  - cover.tapparella_salotto
                  - light.luci_salotto
                  - light.lampadario_salotto
                  - light.lampada_vetrinetta
                  - light.lampada_salotto_2
                  - media_player.tv_salotto
                card:
                  type: picture-glance
                  title: Salotto
                  image: "${vars[0] === 'open' ? '/local/salotto_aperto.jpeg' : '/local/salotto_chiuso.jpeg'}"
                  entities:
                    - entity: light.lampadario_salotto
                    - entity: light.lampada_salotto_2
                    - entity: light.lampada_vetrinetta
                    - entity: cover.tapparella_salotto
                    - entity: media_player.tv_salotto
                  entity: light.luci_salotto```