Fixed icons
This commit is contained in:
parent
261d360cb3
commit
4382c37a3b
@ -15,28 +15,9 @@ export class BatteryService {
|
|||||||
get charging() { return this.lastCharge.reduce((acc, v) => acc + v, 0) / this.lastCharge.length < this.charge; }
|
get charging() { return this.lastCharge.reduce((acc, v) => acc + v, 0) / this.lastCharge.length < this.charge; }
|
||||||
|
|
||||||
get icon() {
|
get icon() {
|
||||||
if (new Date().getTime() - this.lastUpdate > 120000) return 'battery_alert';
|
if(new Date().getTime() - this.lastUpdate > 300000) return 'battery_alert';
|
||||||
|
if(this.charging) return 'battery_charging_full';
|
||||||
let temp = 'battery';
|
return 'battery_full';
|
||||||
if (this.batteries.length) temp += '_charging';
|
|
||||||
|
|
||||||
if (this.average <= 20) {
|
|
||||||
temp += '_20';
|
|
||||||
} else if (this.average <= 30) {
|
|
||||||
temp += '_30';
|
|
||||||
} else if (this.average <= 50) {
|
|
||||||
temp += '_50';
|
|
||||||
} else if (this.average <= 60) {
|
|
||||||
temp += '_60';
|
|
||||||
} else if (this.average <= 80) {
|
|
||||||
temp += '_80';
|
|
||||||
} else if (this.average <= 90) {
|
|
||||||
temp += '_90';
|
|
||||||
} else if (this.average > 90) {
|
|
||||||
temp += 'full'
|
|
||||||
}
|
|
||||||
|
|
||||||
return temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private firestore: AngularFirestore) {
|
constructor(private firestore: AngularFirestore) {
|
||||||
|
Loading…
Reference in New Issue
Block a user