2022-09-23 15:12:39 +00:00
|
|
|
(() => {
|
|
|
|
const move = 20 * 60 * 1000; // 20 minutes
|
|
|
|
const look = 20 * 1000; // 20 seconds
|
|
|
|
|
2022-09-25 21:36:53 +00:00
|
|
|
const buzz = _ => {
|
2022-09-23 15:12:39 +00:00
|
|
|
const date = new Date();
|
|
|
|
const day = date.getDay();
|
|
|
|
const hour = date.getHours();
|
|
|
|
// buzz at work
|
2022-09-25 21:36:53 +00:00
|
|
|
if (day >= 1 && day <= 5 &&
|
|
|
|
hour >= 8 && hour <= 17) {
|
2022-09-23 15:12:39 +00:00
|
|
|
Bangle.buzz().then(_ => {
|
|
|
|
setTimeout(Bangle.buzz, look);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
setInterval(buzz, move); // buzz to stand / sit
|
2022-09-25 21:36:53 +00:00
|
|
|
})();
|