mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-26 03:56:34 +00:00
Fix plant card batteryLvl 100 icon (#1130)
* Fix plant card batteryLvl 100 icon * Update ha-plant-card.html
This commit is contained in:
parent
4c6d9602ae
commit
ac38fdb9df
@ -76,11 +76,15 @@ class HaPlantCard extends window.hassMixins.EventsMixin(Polymer.Element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
computeIcon(attr, batLvl) {
|
computeIcon(attr, batLvl) {
|
||||||
|
const icon = this.sensors[attr];
|
||||||
if (attr === 'battery') {
|
if (attr === 'battery') {
|
||||||
return batLvl <= 5 ? `${this.sensors[attr]}-alert` :
|
if (batLvl <= 5) {
|
||||||
`${this.sensors[attr]}-${(Math.round((batLvl / 10) - 0.01) * 10).toString()}`;
|
return `${icon}-alert`;
|
||||||
|
} else if (batLvl < 95) {
|
||||||
|
return `${icon}-${Math.round((batLvl / 10) - 0.01) * 10}`;
|
||||||
}
|
}
|
||||||
return this.sensors[attr];
|
}
|
||||||
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
computeValue(attributes, attr) {
|
computeValue(attributes, attr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user