Merge pull request #2949 from bobrippling/chargerot-setting-read

chargerot: handle missing settings (e.g. first install)
pull/2951/head
Gordon Williams 2023-08-04 09:41:25 +01:00 committed by GitHub
commit 2e261b3a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Handle missing settings (e.g. first-install)

View File

@ -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) => {

View File

@ -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",