reptilex / tesla-style-solar-power-card

Home assistant power card mimicking the one tesla provides for the powerwall app.
211 stars 59 forks source link

Flow line gap and battery-to-grid line fixes #93

Closed mrgadget closed 2 years ago

mrgadget commented 2 years ago

PR as requested;

I haven't made it a config variable yet as I'm not sure how to - can look to do it at some stage, but figured it's probably easier to just give you this and then it's a 5 minute job for you to turn it into a config variable?

Also, to get it to compile, I had to rename services/htmlWriterForPowerCard.ts to HtmlWriterForPowerCard.ts (capitalising the first letter) - haven't done that in this PR as not sure how you'd like it fixed.

reptilex commented 2 years ago

Thanks, but from what I remember of my own card, the class for resizing needs also to be changed, am I right? Have you tested this? It should only work at the beginning and then stay without gap. Or am I missing something here?

mrgadget commented 2 years ago

Yes I've been running with this for a couple of months - I just copied the code into a new branch to create this PR.

You're not missing anything though - I hadn't gone looking for any resize code. I always used to have issues whereby the whole graphic would shrink to nothing on resize, but that appears to be fixed now (not by my doing). I have just tried resizing the window a few times and the gaps appear to stay?

LucaDiba commented 2 years ago

@reptilex, do you have any updates regarding this PR? Thanks! :)

mp3guy commented 2 years ago

I tested out this PR too and it works great on Desktop and mobile. I also made my own change of setting the grid to house and grid to battery lines to white to be more consistent with the other styling. I just copied the .js from my HACS install out to /www, then modified the json directly. Screenshot from 2022-01-31 11-21-45

MicheleMercuri commented 2 years ago

works a charme, many thanks mrgadget maybe power dashboard need a bit resize to fit with energy panel :) Cattura )

mrgadget commented 2 years ago

great that you got it working, see you found the PR for the code, good work. Impressive dashboard you have there @MicheleMercuri!

sOckhamSter commented 2 years ago

I tweaked a local copy of the .js file with your adjustments over the weekend @mrgadget and I must say it's a massive improvement aesthetically. It would be great if @reptilex could merge this with the official branch so as everyone could benefit.

reptilex commented 2 years ago

finally found the time to update, repair tests and merge. Sorry for taking so long