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

icon_color option for entities #3956

Closed
wants to merge 4 commits into from

Conversation

iantrich
Copy link
Member

@iantrich iantrich commented Oct 8, 2019

partial for #3897

Wanting to get feedback on supporting icon_color how hs_color was supported or if something else should be pursued.

Docs: TODO

@bramkragten
Copy link
Member

What format would this config be in?

@bramkragten
Copy link
Member

We still need to have a good strategy for colouring icons btw

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

What format would this config be in?

icon_color:
  - 200 // hue
  - 100 // sat

which I don't particular like

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

We still need to have a good strategy for colouring icons btw

what do you mean by this?

@bramkragten
Copy link
Member

What format would this config be in?

icon_color:
  - 200 // hue
  - 100 // sat

which I don't particular like

No that kinda sucks

@bramkragten
Copy link
Member

We still need to have a good strategy for colouring icons btw

what do you mean by this?

We should have a strategy for giving colors to state icons, like in what state what color. Like we have for lights and switches now, and has been asked for the other domains.

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

We should have a strategy for giving colors to state icons, like in what state what color. Like we have for lights and switches now, and has been asked for the other domains.

Something to be tackled with a theming refactoring, I think. Personally I think "on" should just be active color for everything, I didn't really care for the whole "sun" reasoning

@bramkragten
Copy link
Member

We should have a strategy for giving colors to state icons, like in what state what color. Like we have for lights and switches now, and has been asked for the other domains.

Something to be tackled with a theming refactoring, I think. Personally I think "on" should just be active color for everything, I didn't really care for the whole "sun" reasoning

It is not about theming, it is about the discussion in:
#2398
#1716
#2431

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

It is not about theming, it is about the discussion in:

It is partially about theming as if we split sun-active vs regular-active it will be another css var. Like I said, I think on should just be on...

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

regardless of the outcome of that discussion, I would still like to introduce icon_color

@Misiu
Copy link
Contributor

Misiu commented Oct 8, 2019

@iantrich sorry if this is noob question, but will this change allow setting color based on state? For example in template sensor I'd like to have 2 states, so I'd like to be able to specify a icon color template that will return color based on my condition, similar to icon template. Hope this will be possible.

@iantrich
Copy link
Member Author

iantrich commented Oct 8, 2019

@Misiu no, it is just a static option

@arsaboo
Copy link
Contributor

arsaboo commented Oct 8, 2019

Hopefully, the dynamic option will come soon after 😉

@Mariusthvdb
Copy link
Contributor

Hopefully, the dynamic option will come soon after 😉

+1 to that!

Adding to that, it would be one of the most sought after features to implement in the backend for customize: Have the possibility to set icon_color (and even better, have the option of using a template) for all entities....
If that would be done, Lovelace cards would simply inherit the color setting for the icon....

@Misiu
Copy link
Contributor

Misiu commented Oct 9, 2019

There is icon_template, there should be icon_color_template.
This shouldn't be hard, because icon_template already works.
@arsaboo @iantrich where should we address this? In which repo? https://github.com/home-assistant/home-assistant?
I've searched that repo for icon_template string and found only a couple of places.
Adding icon_color_template should look almost identical?

Sorry for all those questions - I'm still new to HA and just starting with Python.

@iantrich iantrich added this to the 0.101 milestone Oct 10, 2019
@bramkragten
Copy link
Member

bramkragten commented Oct 10, 2019

I'm thinking about this a bit more, but this should be done in themes, like all styling. And we already have a state-icon-color or iron-icon-fill-color theme option, so this is already possible?

@iantrich
Copy link
Member Author

iantrich commented Oct 10, 2019

How do you theme per entity on an entities card?

@iantrich iantrich changed the title icon_color option for entity-button icon_color option for entities Oct 10, 2019
@bramkragten
Copy link
Member

I was still at the entity_button this started with... 😛 but we should not mix this. Theming should be done with themes, so set a theme per entity might be bit overkill? Giving icons active colors based on states is something we can discuss.

@iantrich
Copy link
Member Author

My concern with going the theme route for active/inactive is that it is not always that clear cut and your themes are going to be a disaster trying to handle edge cases/different views/cards.

e.g. a weather alert sensor.
no alerts: green
weather watch alert: yellow
weather warning alert: red

Theming that sounds difficult and non-intuitive. That may keep individual our element code a little bit simpler, but it makes configuration of each card/entity much more difficult for a user.

And on the topic of per-entity; I do see a need for it and is far from overkill.
e.g. motion in my bedroom when the alarm is set vs motion at my front door when the alarm is set. They are the same type of sensor, but their importance, which I might want to signify via color, is very different.

@Misiu
Copy link
Contributor

Misiu commented Oct 11, 2019

@bramkragten I don't know if this is related, but I've created PR that adds support for icon_color_template that could be used to set icon color similar way we can set icon.
home-assistant/core#27455

@iantrich
Copy link
Member Author

@Misiu that looks great for power users looking to do some really heavy lifting; but if I just want a single icon to be purple, I should be able to make it purple without grabbing a custom card or setting up a backend template.

@iantrich iantrich removed this from the 0.101 milestone Oct 11, 2019
@iantrich iantrich removed the wip label Oct 11, 2019
@iantrich iantrich closed this Dec 15, 2019
@iantrich iantrich deleted the button-icon-color branch January 11, 2020 15:49
@github-actions github-actions bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants