mirror of https://github.com/espruino/BangleApps
[sleeplog] Switch unchanged data behav. in trigger
parent
dfe57c0e77
commit
855a2c4263
|
@ -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
|
||||
|
||||
|
||||
---
|
||||
|
|
|
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue