Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added graphical options #283

Merged
merged 3 commits into from
Jun 15, 2023
Merged

Added graphical options #283

merged 3 commits into from
Jun 15, 2023

Conversation

gauner666
Copy link
Contributor

Added Transparency for unused lines (path)
Added Grey out option for unused lines (path)

Added Grey out option for unused lines (path)
@flixlix
Copy link
Owner

flixlix commented Jun 15, 2023

Thank you very much for your PR, on first glance it looks nice.

I'll review it with more detail later today

@gauner666
Copy link
Contributor Author

Great, please feel free to adopt and improve the code whereever / whenever you want :)

@flixlix
Copy link
Owner

flixlix commented Jun 15, 2023

Thank you once again for the PR, really liked the idea and clean implementation!

The first thing I noticed is that, by default the "zero lines" were greyed out. I would like to have this option, but by default the card should still resemble the behavior of the HA Energy Distribution Card, so I changed this to being an "opt in" option.

I also found a few weird issues between the showLine and styleLine functions, they should be fixed now.

(I read your comment in the HA Community page: Feel free to open another PR to fix the display_zero_tolerance discrepancies, I would honestly just set the states to 0 if they're below the tolerance, and not rely on the showLine and styleLines functions to be able to distinguish a 0 value and a value below tolerance. The functions should be as dumb as possible. I think this PR should not address this issue. 👍)

When seeing the greyout functionality, I thought that people might want to be able to customize this color to fit with their themes, so I decided to make this color configurable.

I also changed how this is configured in the YAML, so it will lead to some breaking changes regarding the display_zero_lines, but I think it is more organized this way.

I noticed that with you configuration it is possible to grey out as well as set the opacity to that grey color.
At first I though, I wanted to display this differently in the UI Editor, but had to get creative to be able to still have this functionality:

Bildschirmaufnahme.2023-06-15.um.18.56.28.mov

Hopefully you like this implementation.
If you don't mind, I'll just shamelessly push the changes onto your branch 😅
Feel free to test these changes and give me some feedback!

flixlix added 2 commits June 15, 2023 19:24
This commit applies all of the changes discussed in the PR

`display_zero_lines` is no longer of type boolean
@gauner666
Copy link
Contributor Author

Very very nice. I like the way you improved my thoughts - I see your passion in this project.
I tested the code and everything is working as expected. Great!
I think you can go live with this code :)
About the 'display_zero_tolerance discrepancies' -> I'm facing a busy day tomorrow so if you find time you don't have to wait for my PR!
Wish you a nice evening!

@flixlix flixlix merged commit 56167d6 into flixlix:main Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants