diff --git a/apps/gipy/README.md b/apps/gipy/README.md index 497892990..58040bfea 100644 --- a/apps/gipy/README.md +++ b/apps/gipy/README.md @@ -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) - 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. +- powersave by default: when gipy starts is powersaving activated ? (see below) ### Powersaving 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 : - 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 slow (< *wake-up speed* setting (13 km/h by default)) +- you are lost - you press the button / touch the screen diff --git a/apps/gipy/app.js b/apps/gipy/app.js index 46e29c359..bbbe543e7 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -3,9 +3,10 @@ let displaying = false; let in_menu = false; let go_backwards = false; let zoomed = true; -let powersaving = true; let status; +let initial_options = Bangle.getOptions(); + let interests_colors = [ 0xffff, // Waypoints, white 0xf800, // Bakery, red @@ -32,10 +33,13 @@ var settings = Object.assign( buzz_on_turns: false, disable_bluetooth: true, power_lcd_off: false, + powersave_by_default: false, }, s.readJSON("gipy.json", true) || {} ); +let powersaving = settings.powersave_by_default; + // let profile_start_times = []; // function start_profiling() { @@ -678,6 +682,9 @@ class Status { this.old_times = []; // the corresponding times } activate() { + if (!powersaving) { + return; + } this.last_activity = getTime(); if (this.active) { 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 if (!this.default_options) { this.default_options = true; - - Bangle.setOptions({ - lockTimeout: 0, - backlightTimeout: 10000, - wakeOnTwist: true, - powerSave: true, - }); + Bangle.setOptions(initial_options); } } else { - if (this.default_options) { + if (this.default_options && powersaving) { this.default_options = false; Bangle.setOptions({ diff --git a/apps/gipy/settings.js b/apps/gipy/settings.js index 1b030f5cd..fff1f8f79 100644 --- a/apps/gipy/settings.js +++ b/apps/gipy/settings.js @@ -9,6 +9,7 @@ disable_bluetooth: true, brightness: 0.5, power_lcd_off: false, + powersave_by_default: false, }, require("Storage").readJSON(FILE, true) || {} ); @@ -82,5 +83,12 @@ writeSettings(); } }, + "powersave by default": { + value: settings.powersave_by_default == true, + onchange: (v) => { + settings.powersave_by_default = v; + writeSettings(); + } + } }); });