Nerf power-type check for firmware issue (espruino/Espruino#2529)

pull/3498/head
Rob Pilling 2024-07-11 21:14:28 +01:00
parent ef0c6a7708
commit ce33c3a662
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ exports.get = function () {
var batt = E.getBattery();
var usage = 0;
for (var key in pwr.device) {
if (!/^(LCD|LED)/.test(key))
if (!key.startsWith("LCD"))
usage += pwr.device[key];
}
var hrsLeft = 175000 * batt / (100 * usage);

View File

@ -14,7 +14,7 @@ exports.get = (): PowerUsage => {
const batt = E.getBattery();
let usage = 0;
for(const key in pwr.device){
if(!/^(LCD|LED)/.test(key))
if(!key.startsWith("LCD"))
usage += pwr.device[key];
}