mirror of https://github.com/espruino/BangleApps
Merge pull request #2949 from bobrippling/chargerot-setting-read
chargerot: handle missing settings (e.g. first install)pull/2951/head
commit
2e261b3a56
|
@ -1 +1,2 @@
|
|||
0.01: New App!
|
||||
0.02: Handle missing settings (e.g. first-install)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
(() => {
|
||||
const chargingRotation = 0 | require('Storage').readJSON("chargerot.settings.json").rotate;
|
||||
const chargingRotation = 0 | (require('Storage').readJSON("chargerot.settings.json",1)||{}).rotate;
|
||||
const defaultRotation = 0 | require('Storage').readJSON("setting.json").rotate;
|
||||
if (Bangle.isCharging()) g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
|
||||
Bangle.on('charging', (charging) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "chargerot",
|
||||
"name": "Charge LCD rotation",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
|
||||
"icon": "icon.png",
|
||||
"tags": "battery",
|
||||
|
|
Loading…
Reference in New Issue