Danielhiversen / home_assistant_tibber_custom

Display Tibber prices and energy consumption as a graph. Tibber is available in Germany, Norway and Sweden Tibber has helped tens of thousands of new customers each month in Sweden, Norway & Germany to lower their energy bill and consumption. Tibber is using digital technology to make electricity consumption smarter. If you use this link to signup for Tibber, you get 50 euro to buy smart home products in the Tibber store: https://invite.tibber.com/6fd7a447
Apache License 2.0
80 stars 17 forks source link

Dark colors and new function #21

Closed tedenda closed 1 year ago

tedenda commented 3 years ago

Hello Daniel!

I am running on dark theme in HA and this component was very bright in my setup so I changed colors. This is work in progress and I want some help. My thinking is that this component maybe can detect if HA is in dark och bright mode, but I don't know how to do this. I have also made a new "function" that change the color on the current line and current price color depending on the price level, but it could be done with the build in price levels in Tibber integration, possible? I aslo moved all definitions of colors to one place so change is easier and can be put in a IF statement later if theme is detectable.

To end this, thanks for a nice component, I like it a lot, very easy for whole family to follow the price!

image

Danielhiversen commented 3 years ago

Ahh, nice 👍

I am not sure it is possible to auto-detect dark mode. The theme is sat on user level so different users can have different themes. The price image is global for all users.

You could make it configurable?

tibber_custom:
   use_dark_mode:  true
tedenda commented 3 years ago

Yes we can start with a setting, that is a good start. Can you give me a pointer on how that is done, I am still learning...

tedenda commented 3 years ago

I looked at some of your other HASS components and got started. How to bring the config over to TibberCam is a topic for tomorrow.

tedenda commented 3 years ago

Hello, I am stuck with this, I understand that I need to read the setting when component starts and pass it to the code that is generating the graph, but I can't figure it out and get it to work. There seems to be alternatives by looking in other components you done and others.

Can you help me out a little bit?

Danielhiversen commented 3 years ago

Try to print the config here

https://github.com/Danielhiversen/home_assistant_tibber_custom/blob/c68fe86de22572b2efc9803481778e0f471716ea/custom_components/tibber_custom/camera.py#L16-L20

Then you should be able to add it as an input argument to TibberCam

dieugab commented 1 year ago

@tedenda did this ever get merged? Making it configurable would help out at least

tedenda commented 1 year ago

No, I didn't figure it out how to add a config for it.