iantrich / config-template-card

📝 Templatable Lovelace Configurations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dashboard wide variable disappears in Companion app when properly running in Firefox / MacOS

kcofoni opened this issue · comments

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue: 1.3.6

Last working release (if known): unknown

Browser and Operating System: Companion app and iOS 17

Description of problem:
When a card use a dashboard wide variable, it greatly works on my mac with Firefox but this card does not appear any more on my iphone with companion. My dashboard is a grid layer.
If I replace this global variable (defined as config_template_card_vars in my dashboard) by a local one (in a "variables section"defined in each card), no more issue.

Javascript errors shown in the web inspector (if applicable): none


Additional information:

Add some MINIMAL code.
Create a global var based on “sun.sun” and try using it.

I. The one that works perfectly everywhere

type: custom:config-template-card
variables:
  BONJOUR_LOCAL: new String('Bonjour !')
entities:
  - sun.sun
card:
  type: entities
  title: ${BONJOUR_LOCAL}
  entities:
    - sun.sun

This card works perfectly within desktop/firefox/macOS and iOS/companion
image

II. The one that does not appear on my iOS/companion

config_template_card_vars:
  BONJOUR: new String('Hello !')
views:
...
type: custom:config-template-card
entities:
  - sun.sun
card:
  type: entities
  title: ${BONJOUR}
  entities:
    - sun.sun

This card works perfectly within desktop/firefox/macOS but is not displayed within Companion on my iPhone
image

Hope this helps 😄

Do not see any issues here.

config_template_card_vars:
  BONJOUR_GLOBAL: new String('Good bye !')
...
title: test-0
path: test-0
cards:

  - type: custom:config-template-card
    variables:
      BONJOUR_LOCAL: new String('Bonjour !')
    entities:
      - sun.sun
    card:
      type: entities
      title: ${BONJOUR_LOCAL}
      entities:
        - sun.sun

  - type: custom:config-template-card
    entities:
      - sun.sun
    card:
      type: entities
      title: ${BONJOUR_GLOBAL}
      entities:
        - sun.sun

Win10+Chrome:
изображение
Same in iOS Companion App.

Reset a frontend cache in Companion App.

After resetting companion app front cache (or whatever...) it is now working. Great custom card ! Thanks