Lovelace Card Preloader

I just tried to install this a HACS custom repository and thee was an error that said it might not be HACS compliant.

Just an FYI.

I just tried it and it worked for me without any warning on HACS 0.23 (I was previously on HACS 0.22.3 and I believe it was working on that as well). Double check that you are adding the correct URL, since the only way I got a warning to appear was when I accidentally put in the URL of a repository which was already there as a default repository).

I just tried again with the same result.

here is the custom repo entry:

and here is the error:

ex1

I don’t know if it’s a HACS error or something with your repo. I’m running HACS v0.23.0 as well.

I’ve just been able to reproduce the issue. Try re-adding the repo without the forward slash on the end of the URL, it looks like that confuses the GitHub API.

yeah, that seemed to be the issue.

I don’t think i ever had to worry about removing that before. I just copied whatever the address was that was in the address bar and it always worked.

Thanks!

Installed in 0.107.0b0 and WORKS! Thanks @Steven_Rollason :+1:

1 Like

I’m still on 0.106.6 and am seeing this error:

ERROR (MainThread) [frontend.js.latest.202001303] https://<redacted>.duckdns.org/hacsfiles/lovelace-card-preloader/lovelace-card-preloader.js:1:1056 TypeError: window.loadCardHelpers is not a function

Config:

preload:
  - conditional
  - entities
  - glance
  - history-graph
  - horizontal-stack
  - markdown
  - picture-entity

That’s odd, that should still work in 0.106 - I tested it successfully myself on 0.106.6.
The only difference I’ve noticed between running this in 0.106 and 0.107 is that some cards (such as markdown) don’t give the config errors in 0.107 as they do in 0.106 (presumably a default config is being used for those cards in 0.107) but everything else seems identical.

hmm, updated to 107.0 , i also now added the plugin with hacs
i added this code to the top of my ui-lovelace.yaml file

preload:
  - picture-elements

but still receive this error:

Custom element doesn't exist: hui-picture-elements-card.

this is my config:

  - type: horizontal-stack
    cards:      
      - !include ../includes/blank-card.yaml
      - type: custom:decluttering-card
        template: person
        variables: 
          - name: fabio
....

my template:

card:
  type: picture-elements
  style: |
    ha-card {
      border-radius: var(--border-radius);
      overflow: hidden;
    }
  image: '[[image]]'
  elements:
    - type: image
      entity: person.[[name]]
      image: '[[image]]'
.....

Same issue as @pergola.fabio but I’m unable to find the lovelace card preloader in HACS.

You have to add it as a custom repository.

Sorry, missed that bit. Thanks

so, this preloading thing is just a temporary workaround until the actual custom card (eg: vertical-stack-in-card) is updated for 107, right?

1 Like

Doesn’t sound like it for the hui- trick from this comment:

I’m getting the same error in HACS and your suggestion didn’t seem to work for me. Forward slash or not, at the end, it’s not allowing me to add the repo.

It works: Just add it with the following settings:

URL: https://github.com/gadgetchnnel/lovelace-card-preloader
Type: Plugin

@Steven_Rollason : Where do I put the preload statement if I do not use ui-lovelace.yaml? I manage my Lovelace from the inbuilt editor in the frontend.

1 Like

Use the RAW editor. Put it at the top of your Lovelace config.

So is this going to be added to hacs properly?

I’ve submitted a PR to add to to the default HACS repositories, I’ll let you know when it’s completed

1 Like

It’s done :tada:

1 Like