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

Theme color fixes #14672

Merged
merged 8 commits into from
Dec 9, 2022
Merged

Theme color fixes #14672

merged 8 commits into from
Dec 9, 2022

Conversation

piitaya
Copy link
Member

@piitaya piitaya commented Dec 9, 2022

Proposed change

  • Use yellow color by default for binary_sensor.
  • Introduce two colors for inactive and unavailable : --rgb-state-unavailable-color and --rgb-state-inactive-color.
  • Changes have been applied to entities card, button card, entity card, glance card, tile card, history, logbook, more-info state

Examples

Tile card

CleanShot 2022-12-09 at 14 47 03

Button card with state_color option (active, inactive, unavailable)

CleanShot 2022-12-09 at 14 33 54

Button card without state_color option (active, inactive, unavailable)

CleanShot 2022-12-09 at 14 34 00

Button card with binary sensor color (alerting active, normal active, inactive)

CleanShot 2022-12-09 at 14 37 28

Entities card with state_color option

CleanShot 2022-12-09 at 14 54 32

Entities card without state_color option

CleanShot 2022-12-09 at 14 54 46

History

CleanShot 2022-12-09 at 14 40 31

Logbook

CleanShot 2022-12-09 at 14 49 15

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@piitaya piitaya marked this pull request as ready for review December 9, 2022 13:56
@prof7bit
Copy link

prof7bit commented Dec 9, 2022

I suspect that with this it will be messed up again :-(

consider this:
off-colors

In the usual state all 3 icons are blue. In the off state it will take its colors from the theme, no matter whether state_colors is active or not.

Now the door sensor and the light switch will become grey while the thermometer icon will stay blue.

The configurable off- and unavailable colors should only be applied to the history graph. The entities icons should continue to take these colors from the theme. Anything else would destroy consistency!

@prof7bit
Copy link

prof7bit commented Dec 9, 2022

Please allow for these new colors to accept the value undefined (and make that the default) and then make all colors behave like they did before.

@piitaya
Copy link
Member Author

piitaya commented Dec 9, 2022

Thanks for the feedback.

For lovelace card, we will replace the state_color with an icon_color_mode options with 3 modes in another PR.

Mode none

All the state stays dark blue : it's like the state_color: false

Mode active

All active state yellow and the others default theme color (dark blue) : it's like the state_color: true

Mode state

Dynamic color according the state. The grey color will be applied to off state for consistency with history and logbook colors.

@ildar170975
Copy link
Contributor

ildar170975 commented Dec 9, 2022

we will replace the state_color with an icon_color_mode options

  1. What is a difference between "active" & "state" if talking about binary sensors?
  2. Is it a good idea to REPLACE an option? May be better to add the 3rd possible value - like "false, true + smth_else"? Then people will NOT have to rewrite their code (again!).

@piitaya
Copy link
Member Author

piitaya commented Dec 9, 2022

  1. in active mode : binary sensor will be all yellow (like we had 2022.11 version)
    In state mode : binary sensor will be yellow and red depending the device_class

  2. Don't worry, backward compatibility will be done.

@balloob balloob merged commit 23573d8 into dev Dec 9, 2022
@balloob balloob deleted the theme_color_fixes branch December 9, 2022 15:04
@prof7bit
Copy link

prof7bit commented Dec 9, 2022

Mode active

All active state yellow and the others default theme color (dark blue) : it's like the state_color: true

Ok, this sounds reasonable. My blood pressure is already relaxing back to normal levels again. Thank you.

@ildar170975
Copy link
Contributor

How the new icon_color_mode will be processed for other domains like sun, device_tracker, person, sensor (battery level), lock, cover?
Does it mean that "icon_color_mode = active" will make these entities of 2 colors too?
Wil it be same "some blue-ish" and "amber"?

@piitaya
Copy link
Member Author

piitaya commented Dec 9, 2022

How the new icon_color_mode will be processed for other domains like sun, device_tracker, person, sensor (battery level), lock, cover? Does it mean that "icon_color_mode = active" will make these entities of 2 colors too? Wil it be same "some blue-ish" and "amber"?

Same rules as before.

@lordwizzard
Copy link

I'm throwing this out on the color usage, but can also cover audio usage. Please remember about those who have trouble with seeing colors (color challenged versus color blind) and the hearing impaired. So if you are writing the changes you should remember there is a certain percentage of the world you maybe missing in your designs. Heaven forbid that groups who monitor software that drives web interfaces or programs used in everyday life send you legal/court papers forcing you to prove your designs are not discriminatory. Just food for those doing the design to think about.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
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.

Color of states Off and Unavailable are the same in History graph card in release 2022.12
6 participants