Daisy testing

master
David Volovskiy 2025-02-23 10:58:24 -05:00
parent 75dedf7400
commit fe82a62f7c
3 changed files with 12 additions and 6 deletions

View File

@ -224,7 +224,10 @@ function draw() {
function drawClock() {
var date = new Date();
var hh = date.getHours();
if (settings.hr_12) hh = hh % 12;
if (settings.hr_12) {
hh = hh % 12;
if (hh == 0) hh = 12;
}
hh = hh.toString().toString().padStart(2, '0');
var mm = date.getMinutes()
var p_steps;
@ -238,6 +241,9 @@ function drawClock() {
case 'Steps':
p_steps = Math.round(100*(getSteps()/10000));
break;
case 'Battery':
p_steps = E.getBattery();
break;
}
mm = mm.toString().padStart(2, '0');
@ -608,9 +614,9 @@ function buzzer(n) {
// timeout used to update every minute
var drawTimeout;
// schedule a draw for the next minute or every 2 seconds
// schedule a draw for the next minute or every 5 seconds
function queueDraw() {
let delay = (settings.ring == 'Seconds') ? (2000 - (Date.now() % 2000)) : (60000 - (Date.now() % 60000));
let delay = (settings.ring == 'Seconds') ? (5000 - (Date.now() % 5000)) : (60000 - (Date.now() % 60000));
if (drawTimeout) clearTimeout(drawTimeout);
drawTimeout = setTimeout(function() {
drawTimeout = undefined;

View File

@ -1,6 +1,6 @@
{ "id": "daisy",
"name": "Daisy",
"version": "0.15",
"version": "0.17",
"dependencies": {"mylocation":"app"},
"description": "A beautiful digital clock with large ring guage, idle timer and a cyclic information line that includes, day, date, steps, battery, sunrise and sunset times",
"icon": "app.png",

View File

@ -27,7 +27,7 @@
var color_options = ['Green','Orange','Cyan','Purple','Red','Blue'];
var fg_code = ['#0f0','#ff0','#0ff','#f0f','#f00','#00f'];
var gy_code = ['#020','#220','#022','#202','#200','#002'];
var ring_options = ['Minutes', 'Seconds', 'Steps'];
var ring_options = ['Minutes', 'Seconds', 'Steps', 'Battery'];
E.showMenu({
'': { 'title': 'Daisy Clock' },
@ -66,7 +66,7 @@
},
'Ring Display': {
value: 0 | ring_options.indexOf(s.ring),
min: 0, max: 2,
min: 0, max: 3,
format: v => ring_options[v],
onchange: v => {
s.ring = ring_options[v];