[TerminalClock] Add sensible default settings

pull/1979/head
Stiralbios 2022-06-18 19:16:44 +02:00
parent c50813322c
commit f77226e33e
2 changed files with 16 additions and 7 deletions

View File

@ -29,7 +29,16 @@ const clock = new ClockFace({
if (this.PowerOnInterval === undefined) this.PowerOnInterval = 15;
if (this.powerSaving===undefined) this.powerSaving = true;
["L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9"].forEach(k => {
if (this[k]===undefined) this[k] = "Empty";
if (this[k]===undefined){
if(k == "L2") this[k] = "Date";
else if(k == "L3") {
this[k] = "HR";
this.showHRM = true;
}else if(k == "L4") this[k] = "Motion";
else if(k == "L5") this[k] = "Steps";
else if(k == "L6") this[k] = ">";
else this[k] = "Empty";
}
else if (this[k]==="HR") this.showHRM = true;
else if (this[k]==="Alt") this.showAltitude = true && process.env.HWVERSION == 2;
});

View File

@ -8,11 +8,11 @@
HRMinConfidence: 50,
powerSaving: true,
PowerOnInterval: 15,
L2: 'Empty',
L3: 'Empty',
L4: 'Empty',
L5: 'Empty',
L6: 'Empty',
L2: 'Date',
L3: 'HR',
L4: 'Motion',
L5: 'Steps',
L6: '>',
L7: 'Empty',
L8: 'Empty',
L9: 'Empty',
@ -102,4 +102,4 @@
}
E.showMenu(getMainMenu());
})();
})