Skip to content

Commit

Permalink
Merge pull request #78 from sulkaharo/dev
Browse files Browse the repository at this point in the history
Release 1.6.5
  • Loading branch information
sulkaharo authored Oct 6, 2024
2 parents b437fb9 + 0875c1d commit fb87785
Show file tree
Hide file tree
Showing 12 changed files with 2,701 additions and 2,931 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.17.0
12 changes: 7 additions & 5 deletions app/alarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class Alarms {
this._snoozes = {};
ui.init(this);
this._ui = ui;
this._bodyPresence = settings.bodyPrecense;
}

removeSnooze(type) {
Expand Down Expand Up @@ -54,7 +55,7 @@ export default class Alarms {
const fileAge = Date.now() - fileGenerationTime;
const deltaMins = Math.floor(fileAge / 1000 / 60);

if (fileAge > 10*60*1000) {
if (fileAge > 10 * 60 * 1000) {

const messageTime = deltaMins > 30 ? ">30" : deltaMins;

Expand Down Expand Up @@ -105,8 +106,8 @@ export default class Alarms {

let deltaDivisor = 1;

if ((entry.date - prevEntry.date) > 10*60*1000) {
deltaDivisor = Math.floor((entry.date - prevEntry.date) / (5*60*1000)) + 1;
if ((entry.date - prevEntry.date) > 10 * 60 * 1000) {
deltaDivisor = Math.floor((entry.date - prevEntry.date) / (5 * 60 * 1000)) + 1;
}

// use interpolated delta when readings are missed
Expand Down Expand Up @@ -165,8 +166,9 @@ export default class Alarms {

const hour = new Date().getHours();
const nightTimeOff = (hour >= 21 || hour <= 7) && settings.alarmsOffDuringNight;
const bodyOff = settings.alarmOffBody && this._bodyPresence && !this._bodyPresence.present;

if (!this._settings.enableAlarms || nightTimeOff) {
if (!this._settings.enableAlarms || nightTimeOff || bodyOff) {
return;
}

Expand All @@ -175,7 +177,7 @@ export default class Alarms {

const a = this.checkAlarms(entry, prevEntry, fileGenerationTime);
const alarms = this.snoozeFilterAlarms(a);

if (alarms.length > 0) {
// Show whatever is the latest highest priority alarm
this._activeAlarm = alarms[0];
Expand Down
Loading

0 comments on commit fb87785

Please sign in to comment.