davet2001 / energy-sankey

Simple electrical flow Sankey cards for Home Assistant, visually displaying energy usage
Apache License 2.0
5 stars 0 forks source link

Unavailable power entities should report 0W #5

Closed davet2001 closed 1 month ago

davet2001 commented 1 month ago

If a power entity such as a solar source is 'unavailable' (which is often normal behaviour outside of sunlight hours), the power graph fails to render (I.e. a blank tile is displayed). A console message is displayed:

Uncaught (in promise) TypeError: routes.phantom is undefined
    renderGenerationToConsumersFlow http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:3959
    render http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:4224
    update http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:79
    performUpdate http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:66
    scheduleUpdate http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:66
    _$Ej http://localhost:8123/local/homeassistant-energy-sankey-card/dist/energy-sankey.js:66
2 energy-sankey.js:3959:21

It should report 0W in those cases.