gipy: powersaving disabled by default + setting
you can enable it by default in the settingsmaster
parent
e1f57fca92
commit
88f45b6714
|
|
@ -121,11 +121,15 @@ Few settings for now (feel free to suggest me more) :
|
||||||
- brightness : how bright should screen be ? (by default 0.5, again saving power)
|
- brightness : how bright should screen be ? (by default 0.5, again saving power)
|
||||||
- power lcd off (disabled by default): turn lcd off when inactive to save power. the watch will wake up when reaching points,
|
- power lcd off (disabled by default): turn lcd off when inactive to save power. the watch will wake up when reaching points,
|
||||||
when you touch the screen and when speed is below 13km/h.
|
when you touch the screen and when speed is below 13km/h.
|
||||||
|
- powersave by default: when gipy starts is powersaving activated ? (see below)
|
||||||
|
|
||||||
### Powersaving
|
### Powersaving
|
||||||
|
|
||||||
Starting with release 0.20 we experiment with power saving.
|
Starting with release 0.20 we experiment with power saving.
|
||||||
|
|
||||||
|
By default, powersaving is **disabled**. You can turn it on in the menu by checking the powersaving box.
|
||||||
|
You can also change the default choice in the app settings (*powersave by default* setting).
|
||||||
|
|
||||||
There are now two display modes :
|
There are now two display modes :
|
||||||
|
|
||||||
- active : the screen is lit back (default at 50% light but can be configured with the *brightness* setting)
|
- active : the screen is lit back (default at 50% light but can be configured with the *brightness* setting)
|
||||||
|
|
@ -140,6 +144,7 @@ Activation events are the following :
|
||||||
|
|
||||||
- you are near (< 100m) the next point on path
|
- you are near (< 100m) the next point on path
|
||||||
- you are slow (< *wake-up speed* setting (13 km/h by default))
|
- you are slow (< *wake-up speed* setting (13 km/h by default))
|
||||||
|
- you are lost
|
||||||
- you press the button / touch the screen
|
- you press the button / touch the screen
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@ let displaying = false;
|
||||||
let in_menu = false;
|
let in_menu = false;
|
||||||
let go_backwards = false;
|
let go_backwards = false;
|
||||||
let zoomed = true;
|
let zoomed = true;
|
||||||
let powersaving = true;
|
|
||||||
let status;
|
let status;
|
||||||
|
|
||||||
|
let initial_options = Bangle.getOptions();
|
||||||
|
|
||||||
let interests_colors = [
|
let interests_colors = [
|
||||||
0xffff, // Waypoints, white
|
0xffff, // Waypoints, white
|
||||||
0xf800, // Bakery, red
|
0xf800, // Bakery, red
|
||||||
|
|
@ -32,10 +33,13 @@ var settings = Object.assign(
|
||||||
buzz_on_turns: false,
|
buzz_on_turns: false,
|
||||||
disable_bluetooth: true,
|
disable_bluetooth: true,
|
||||||
power_lcd_off: false,
|
power_lcd_off: false,
|
||||||
|
powersave_by_default: false,
|
||||||
},
|
},
|
||||||
s.readJSON("gipy.json", true) || {}
|
s.readJSON("gipy.json", true) || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let powersaving = settings.powersave_by_default;
|
||||||
|
|
||||||
// let profile_start_times = [];
|
// let profile_start_times = [];
|
||||||
|
|
||||||
// function start_profiling() {
|
// function start_profiling() {
|
||||||
|
|
@ -678,6 +682,9 @@ class Status {
|
||||||
this.old_times = []; // the corresponding times
|
this.old_times = []; // the corresponding times
|
||||||
}
|
}
|
||||||
activate() {
|
activate() {
|
||||||
|
if (!powersaving) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.last_activity = getTime();
|
this.last_activity = getTime();
|
||||||
if (this.active) {
|
if (this.active) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -778,16 +785,10 @@ class Status {
|
||||||
this.activate(); // if we go too slow turn on, we might be looking for the direction to follow
|
this.activate(); // if we go too slow turn on, we might be looking for the direction to follow
|
||||||
if (!this.default_options) {
|
if (!this.default_options) {
|
||||||
this.default_options = true;
|
this.default_options = true;
|
||||||
|
Bangle.setOptions(initial_options);
|
||||||
Bangle.setOptions({
|
|
||||||
lockTimeout: 0,
|
|
||||||
backlightTimeout: 10000,
|
|
||||||
wakeOnTwist: true,
|
|
||||||
powerSave: true,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.default_options) {
|
if (this.default_options && powersaving) {
|
||||||
this.default_options = false;
|
this.default_options = false;
|
||||||
|
|
||||||
Bangle.setOptions({
|
Bangle.setOptions({
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
disable_bluetooth: true,
|
disable_bluetooth: true,
|
||||||
brightness: 0.5,
|
brightness: 0.5,
|
||||||
power_lcd_off: false,
|
power_lcd_off: false,
|
||||||
|
powersave_by_default: false,
|
||||||
},
|
},
|
||||||
require("Storage").readJSON(FILE, true) || {}
|
require("Storage").readJSON(FILE, true) || {}
|
||||||
);
|
);
|
||||||
|
|
@ -82,5 +83,12 @@
|
||||||
writeSettings();
|
writeSettings();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"powersave by default": {
|
||||||
|
value: settings.powersave_by_default == true,
|
||||||
|
onchange: (v) => {
|
||||||
|
settings.powersave_by_default = v;
|
||||||
|
writeSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue