JonahKr / power-distribution-card

A Lovelace Card for visualizing power distributions.
MIT License
219 stars 13 forks source link

Changing font size #129

Closed jancoetzer closed 1 year ago

jancoetzer commented 1 year ago

Love this card. I can see you really put effort into it, so thanks for that. Just one question and one suggestion: Firstly: Is it possible to specify a font size for the text information, as well as the icon sizes? I have a large dashboard screen, but it is just a bit small to easily recognise, so if I can change the font size manually, that would be perfect.

As for the suggestion: I use 4 gauge cards to show me how much my loads are, with the maximum threshold specified. The center bars only shows percentages (unless I missed something) and I can't specify a maximum, e.g. my total solar production is 2160w, so the gauge maxes out at 2160w (100%). If there could be a way to integrate existing cards and maybe replace the arrows with gauges or something, it would be great? Or something similar. Then I can have one card that shows all the information I want.

Thanks for creating this card!

Screenshot 2023-03-07 at 09 49 37
JonahKr commented 1 year ago

Hi @jancoetzer 👋 Thanks for your kind words! So just to summarize:

  1. You want to be able to change general scaling of the card: This isn't possible yet and to be honest i cannot think of something from the top of my head how i could achieve that without butchering the layout of the card. I will have to look at the existing homeassistant cards and look how they do it.
  2. You want to replace the middle section with a custom card: This is already possible and take a look here in the documentation. It should work just fine but integrating a visual editor for it is a pain and a half, so for now you have to resort to yaml. Just as a tip, instead of writing this all by yourself, you can just edit an existing card, press Edit with YAML and copy and paste it, just watch out for the indentation.
  3. Replacing the arrows: Just from an User Experience point of view i don't think that would be a good idea, since most cards aren't made to be displayed in such a small way and can make the layout really inconsistant (imagine someone adds an entities card). If someone reading this want's to give it a shot, feel free opening a PR and i will gladely review it.

Take care and stay safe! :+1:

JonahKr commented 1 year ago

Hey there 👋 I got a few questions regarding the text scaling. I just checked and i didn't find any settings or methods regarding custom scaling. Additionally the text sizes are exactly the same as in many existing HomeAssistant default cards (entities, gauge etc...)

font-size: var(--paper-font-body1_-_font-size);

As you can see the scaling of the text just depends on the lovelace paper default scales.

Could you maybe point out one specific example where the text is smaller than in homeassistant?

JonahKr commented 1 year ago

Closed due to inactivity. Feel free to reopen once you have more information!