hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
5.22k stars 1.26k forks source link

Wrong resources for custom lovelace in zip #1897

Closed IhorSyerkov closed 3 years ago

IhorSyerkov commented 3 years ago

Installation details

Description Value
HACS version 1.11.2
Home Assistant version 2021.2.2
Installation method for HA supervised

Checklist

Describe the issue

I develop custom lovalece card https://github.com/IhorSyerkov/linak-desk-card. There few js files and I put it into zip archive. According to the HACS docs I created folloving hacs.json file

{
    "name": "LinakDesk Card",
    "render_readme": true,
    "zip_release": true,
    "filename": "linak-desk-card.zip"
}

After I added my custom repo to the hacs and installed the card. The following path was automatically added to resources /hacsfiles/linak-desk-card/linak-desk-card.zip If I change resource path statring to error in hacs store that card is not loaded.

Steps to reproduce

  1. Create custom lovalace card with several files files as zip archive
  2. Add repository to HACS
  3. Install card
if I change `"filename": "linak-desk-card.js"` in `hacs.json`. HACS store stop to accept my repository
hacs-bot[bot] commented 3 years ago

Make sure you have read the issue guidelines and that you filled out the entire template.

ludeeus commented 3 years ago

That option only works for integrations, the documentation should be updated to reflect that.

IhorSyerkov commented 3 years ago

Actually all files were unachieved and putted into right place. The problem only in resource path. It would be good to support zip files for cards as well. For ex. in my case I separate editor and main card and load editor only if someone starts edit card. It reduce initial loaded size of javascript

ludeeus commented 3 years ago

You can still separate it.

IhorSyerkov commented 3 years ago

I didn't find how. if place in release few files like now https://github.com/IhorSyerkov/linak-desk-card/releases/tag/v1.0.0 with config

{
    "name": "LinakDesk Card",
    "render_readme": true,
    "filename": "linak-desk-card.js"
}

HACS addon doesn't accept my repo with error Repostitory structure for v1.0.0 is not compliant

ludeeus commented 3 years ago

Your editor should be linak-desk-card-editor.js but that should not cause that error. The internal cache of HACS might. Try restarting HA.

IhorSyerkov commented 3 years ago

Still getting an error. (tried to restart whole setup)

IhorSyerkov commented 3 years ago
2021-02-12 15:23:31 DEBUG (MainThread) [custom_components.hacs] <Plugin ihorsyerkov/linak-desk-card> Checking repository.
2021-02-12 15:23:31 DEBUG (MainThread) [custom_components.hacs] <Plugin IhorSyerkov/linak-desk-card> Running checks against v1.0.0

only logs what i see from hacs.

IhorSyerkov commented 3 years ago

For now I packed everything back into one js file. But would be nice to have document limitation, and how to split publish separate files for editor