r-renato / ha-card-waze-travel-time

Home Assistant Lovelace card for Waze Travel Time Sensor
MIT License
42 stars 11 forks source link

setConfig is undefined #4

Closed Veldkornet closed 4 years ago

Veldkornet commented 4 years ago

Card-modder is listed as deprecated in favor of card-mod.

Hence, I tried with card-mod but I get the following: r.setConfig is not a function. (In ‘r.setConfig(Object(i.a)(t))’,’r.setConfig’ is undefined

Assuming that this is because of card-mod, could you consider moving over to that since card-modder is deprecated?

r-renato commented 4 years ago

Hi, I use Home Assistant 0.99.3 and for me this code working fine:

                   type: custom:mod-card
                   style: |
                     ha-card {
                       border: 1px solid green;
                     }
                   card:
                     type: custom:ha-card-waze-travel-time
                     headers: false
                     {% if name is defined %}
                     name: {{ name }}
                     {% endif %}
                     columns:
                       - from
                       - to
                       - duration
                       - distance
                       - icon
                     destinations:
                     {% for e in destinations %}
                     - entity: {{ e.entity }}
                       to: {{ e.to }}
                     {% endfor %}

Try to use ha-card-waze-travel-time without mod-card to see if the issue depend on your ha version.

Veldkornet commented 4 years ago

Ah, yes ha-card-waze-travel-time gives the same error, on Home Assistant 0.102.1

Screenshot from 2019-11-23 08-25-32

r-renato commented 4 years ago

Hi, no card type found is an error depend on the import js card.

Check under the heading resources if the card ha-card-waze-travel-time.js import is configured well.

Veldkornet commented 4 years ago

Well, after I added the resources, the addon on HACS went green (where before it was orange). So, to me that looks like it was picked up correctly.

726206F5-B781-4EBD-B18E-3FC405A8E269

r-renato commented 4 years ago

Can you post your real card configuration?

Veldkornet commented 4 years ago

I eventually just added everything via the yaml instead of via the gui and that has seemed to work. It looks the same afterwards in the gui editor, but it seems to work now, so... no problem then ;)

ToRvaLDz commented 4 years ago

I have the same problem, js files are loaded: Home Assistant 0.107.1

Whitout mod-card it works.

tempsnip