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

Fix a color for battery if "unknown" #14665

Closed
3 tasks done
ildar170975 opened this issue Dec 9, 2022 · 2 comments
Closed
3 tasks done

Fix a color for battery if "unknown" #14665

ildar170975 opened this issue Dec 9, 2022 · 2 comments
Labels

Comments

@ildar170975
Copy link
Contributor

ildar170975 commented Dec 9, 2022

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

Looking at here:
https://github.com/home-assistant/frontend/blob/99a69d3a70063083affe596be30cc675f46090ed/src/common/entity/color/battery_color.ts

export const batteryStateColor = (state: string) => {
  const value = Number(state);
  if (isNaN(value)) {
    return "sensor-battery-unknown";
  }
  if (value >= 70) {
    return "sensor-battery-high";
  }
  if (value >= 30) {
    return "sensor-battery-medium";
  }
  return "sensor-battery-low";
};

I expect that unavailable & unknown states will be treated a similar way but with different colors.
But for unknown a color seems to be not defined.

изображение

изображение

Proposal:
Use different colors for unavailable & unknown.
These colors should NOT be same as a "normal" color, i.e. not like it is portrayed on the picture above.
Same colors should be used for History.
Better to use theme variables for these colors.

Same colors for unavailable & unknown also should be used for other domains & device_classes.

Describe the behavior you expected

as above

Steps to reproduce the issue

described above

What version of Home Assistant Core has the issue?

2022.12.0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 108.0.5359.95

Which operating system are you using to run this browser?

Win10x64

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 13, 2023
@ildar170975
Copy link
Contributor Author

Since all other domains seem to have a standard "blue-ish" color for unknown and this does not seem to be reconsidered - it is meaningless to ask a special "unknown" color for "battery" domain.
Closing.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant