BangleApps/apps/chargerot/boot.js

15 lines
600 B
JavaScript
Raw Normal View History

2023-05-25 07:09:11 +00:00
(() => {
const chargingRotation = 0 | require('Storage').readJSON("chargerot.settings.json").rotate;
const defaultRotation = 0 | require('Storage').readJSON("setting.json").rotate;
if (Bangle.isCharging()) g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
2023-05-25 07:09:11 +00:00
Bangle.on('charging', (charging) => {
if (charging) {
g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
Bangle.showClock();
} else {
g.setRotation(defaultRotation&3,defaultRotation>>2).clear();
Bangle.showClock();
}
});
})();