[sleeplog] Switch unchanged data behav. in trigger

pull/2322/head
storm64 2022-11-17 10:26:52 +01:00
parent dfe57c0e77
commit 855a2c4263
2 changed files with 8 additions and 8 deletions

View File

@ -169,12 +169,12 @@ if (typeof (global.sleeplog || {}).trigger === "object") {
The passed data object has the following properties:
- timestamp: of the status change as date object,
(should be around 10min. before "now", the actual call of the function)
- status: if changed the value of the new status (0-4) else undefined,
- status: value of the new status (0-4),
(0 = unknown, 1 = not worn, 2 = awake, 3 = light sleep, 4 = deep sleep)
- consecutive: if changed the value of the new status (0-2) else undefined,
- consecutive: value of the new status (0-2),
(0 = unknown, 1 = no consecutive sleep, 2 = consecutive sleep)
- prevStatus: value of the previous status (0-4),
- prevConsecutive: value of the previous status (0-2)
- prevStatus: if changed the value of the previous status (0-4) else undefined,
- prevConsecutive: if changed the value of the previous status (0-2) else undefined
---

View File

@ -272,10 +272,10 @@ if (sleeplog.conf.enabled) {
// and call afterwards with status data
setTimeout(entry.fn, 100, {
timestamp: new Date(data.timestamp),
status: data.status === this.status ? undefined : data.status,
consecutive: data.consecutive === this.consecutive ? undefined : data.consecutive,
prevStatus: this.status,
prevConsecutive: this.consecutive
status: data.status,
consecutive: data.consecutive,
prevStatus: data.status === this.status ? undefined : this.status,
prevConsecutive: data.consecutive === this.consecutive ? undefined : this.consecutive
});
});
}