You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
Checklist
Describe the issue you are experiencing
Looking at here:
https://github.com/home-assistant/frontend/blob/99a69d3a70063083affe596be30cc675f46090ed/src/common/entity/color/battery_color.ts
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
The text was updated successfully, but these errors were encountered: