AmoebeLabs / flex-horseshoe-card

Flexible Horseshoe card for Home Assistant Lovelace UI. A card with a flexible layout, a horseshoe-like donut graph, multiple entities or attributes, graphics and animations!
278 stars 43 forks source link

cards broken when no internet connection #84

Open studiowena opened 11 months ago

studiowena commented 11 months ago

Hi,

Can You change code to be independed from internet connection and work only from local files downloaded to HA?

i think this broke cards when have no internet connection

import {
  LitElement,
  html,
  css,
  svg
  } from "https://unpkg.com/lit-element@2.0.1/lit-element.js?module";

please change it to work without internet connection

Dackara commented 10 months ago

I have the same problem, it's very disturbing. image

maxpilotevan commented 7 months ago

+1 Did someone find a solution or an alternative to fix this issue ?

gitmarecki commented 7 months ago

seems there is a larger issue with this component - since the server https://unpkg.com is randomly unavailable from different parts of the world (I cannot see it from UAE, but it's perfectly accessible for me from hetzner and azure networks). This of course renders all my dashboards useless ATM...

debugging in chrome confirms it's the problem with access to the third party:

image

When trying to download it manually, it randomly shows cloudflare error after a long timeout or nothing at all...

studiowena commented 7 months ago

whats the problem to have this JS localy on our HA? It should be implemented at beginning... we have to change code to local destination of this script

gitmarecki commented 7 months ago

replacing the path inside /homeassistant/www/community/flex-horseshoe-card/flex-horseshoe-card.js file does not have any effect on existing installation... not sure how to reconfigure it to use this file once the card is already installed.

BTW. looks like the problem with availability of unpkg.com has been addressed and everything is back to normal again.

studiowena commented 7 months ago

replacing the path inside /homeassistant/www/community/flex-horseshoe-card/flex-horseshoe-card.js file does not have any effect on existing installation... not sure how to reconfigure it to use this file once the card is already installed.

BTW. looks like the problem with availability of unpkg.com has been addressed and everything is back to normal again.

there is more import in code in this unpkg... so author need to import all stuff or maybe he cant cuz of license of lib?

ytsopelas commented 6 months ago

Same problem here - hopefully it will be fixed (i.e. cards will become independent of an internet connection).

robotpandarocket commented 5 months ago

+1. I love the horseshoe card but it goes against my principles with my HA installation that it should continue to work without internet. Would be great to get this fixed.

w0vka commented 4 months ago

i think the solution you all are looking for is described in this https://github.com/AmoebeLabs/flex-horseshoe-card/issues/88#issuecomment-2145334978 by @abu9

Simply download the LitElement and you are no longer dependent on the internet.

ytsopelas commented 4 months ago

i think the solution you all are looking for is described in this #88 (comment) by @abu9

Simply download the LitElement and you are no longer dependent on the internet.

Thank you w0vka!