added suggestions from pr
parent
a15e8b665d
commit
e0a2081fc9
|
|
@ -18,16 +18,8 @@ Bangle.drawWidgets();
|
||||||
let brightness;
|
let brightness;
|
||||||
|
|
||||||
function loadBrightness() {
|
function loadBrightness() {
|
||||||
try {
|
const getBrightness = require('Storage').readJSON("setting.json", 1) || {};
|
||||||
const d = require('Storage').readJSON("setting.json", 1) || {};
|
brightness = getBrightness.brightness || 0.1;
|
||||||
brightness = Object.assign({
|
|
||||||
'brightness': 0.1
|
|
||||||
}, d || {});
|
|
||||||
return d;
|
|
||||||
} catch(e){
|
|
||||||
console.log(e.toString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//may make it configurable in the future
|
//may make it configurable in the future
|
||||||
|
|
@ -105,6 +97,7 @@ function printLinearCode(binary) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showCode(card) {
|
function showCode(card) {
|
||||||
|
// set to full bright when the setting is true
|
||||||
if(settings.fullBrightness) {
|
if(settings.fullBrightness) {
|
||||||
Bangle.setLCDBrightness(1);
|
Bangle.setLCDBrightness(1);
|
||||||
}
|
}
|
||||||
|
|
@ -148,8 +141,9 @@ function showCode(card) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showCard(card) {
|
function showCard(card) {
|
||||||
|
// reset brightness to old value after maxing it out
|
||||||
if(settings.fullBrightness) {
|
if(settings.fullBrightness) {
|
||||||
Bangle.setLCDBrightness(brightness.brightness);
|
Bangle.setLCDBrightness(brightness);
|
||||||
}
|
}
|
||||||
var lines = [];
|
var lines = [];
|
||||||
var bodyFont = fontBig;
|
var bodyFont = fontBig;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue