Commit Graph

38 Commits (master)

Author SHA1 Message Date
Anton 34a9d86f20 Fix lint warnings 2024-04-01 17:27:15 +02:00
Ishidres cc259783cd wearTemp is 19.5 by default 2024-03-22 17:59:09 +01:00
Ishidres fed3ef9314 Disable temperature wear detection by default 2024-03-22 16:53:15 +01:00
Ishidres 50afb26b8d Change condition check to !== null 2024-03-22 16:39:35 +01:00
Ishidres 565fb15255 Remove temperature wear check and update wear temperature setting 2024-03-22 16:21:52 +01:00
Ishidres efae29ce35
Undo accidental indent 2024-03-22 13:22:31 +01:00
Ishidres 7cc67ceb27
Add missing else part 2024-03-22 13:02:25 +01:00
Ishidres 177ad56392 Refactor to combine checkIsWearing() and isWornByTemp() 2024-03-21 20:58:08 +01:00
Ishidres 245b78e292 Refactor 2024-03-20 14:52:25 +01:00
Ishidres b02d730a6f set default wear temperature to 29°C 2024-03-20 14:16:59 +01:00
Ishidres c293b8cfc3
Update boot.js 2024-03-15 10:47:43 +01:00
Ishidres 7325cc4d3a Add check for wearing status and set status accordingly 2024-03-11 18:17:00 +01:00
Ishidres ff92b515b6 Fix comparison operator in isNotWorn function 2024-03-11 18:14:08 +01:00
Ishidres c4a25b6be1 Determine if worn based on temperature threshold 2024-03-11 18:10:13 +01:00
Ishidres 853d8eeef3 Add comments about sleep status, fix typo 2024-03-08 00:08:48 +01:00
Gordon Williams ba7a2f7996 Issue newline before GB commands (solves issue with console.log and ignored commands) 2023-06-19 19:19:32 +01:00
Scharf 00a9db1bf0 [sleeplog] Improving triggers and web interface
to 0.13:
- Prevent to stay in consecutive sleep if not worn.
- Correct calling triggers where last time is earlier then first time.
- Add the trigger object itself as argument to the fn function to be able to store data or functions inside the trigger object.

to 0.14:
improvements initiated by #2677
- Add a option to delete all logfiles before a specific date from the watch
- Correct regex file search from `\d\d\d\d` / `\d{4}` to `\d+`
2023-04-05 16:47:09 +02:00
storm64 855a2c4263 [sleeplog] Switch unchanged data behav. in trigger 2022-11-17 10:26:52 +01:00
storm64 dfe57c0e77 [sleeplog] Correct generation of time in trigger 2022-11-17 10:04:57 +01:00
storm64 528716322a [sleeplog] Correct fn call for trigger 2022-11-17 09:26:51 +01:00
storm64 abb719319f [sleeplog] Correct time as date for trigger 2022-11-17 08:36:22 +01:00
storm64 a2fd46e35c [sleeplog] Correct calculation of time in trigger 2022-11-16 23:26:23 +01:00
storm64 9105c94e1b [sleeplog] Replace onChange with trigger object 2022-11-16 22:46:49 +01:00
storm64 56e69cc32c [sleeplog] Initialise .onChange as object 2022-11-10 17:16:44 +01:00
storm64 58330df11c [sleeplog] Change .onChange from array to object 2022-11-10 17:04:54 +01:00
storm64 99663e4583 [sleeplog] onChange: + previous values and readme 2022-11-10 00:33:51 +01:00
storm64 74787f7b5e [sleeplog] Add option for onChange functions
Execute functions in `sleeplog.onChange[fn({timestamp, status, consecutive})]` on a status change
2022-09-12 23:15:39 +02:00
storm64 e9503bb08f
sleeplog: Update boot.js
Check for cached modules before removing to prevent module not found error.
2022-08-17 23:21:35 +02:00
storm64 aef6f638cb [sleeplog] Change caching for global getStats 2022-05-26 11:27:36 +02:00
storm64 76629a9d78 [sleeplog] Add "View log" in debug + send via BT
Add "View log" function for debugging log
Send data for gadgetbridge via BT
2022-05-26 10:41:56 +02:00
storm64 3ec051be9d [sleeplog] Complete rework, BETA v01 2022-05-20 17:17:30 +02:00
storm64 8c4f2f18c9 sleeplog: Correct fix #1445, display loading info while calculating sleep data
Update app.js
 - move complex data analysis into separate function
 - add displaying a loading info
 - faster feedback by calling the analysis through a timeout
Update boot.js
 - correct fix #1445 as mentioned by splitting the `stop()` function to only remove the kill listener on a manual stop
 - optimize `start()` and `stop()` functions
Update README.md
 - change beautified menu entries according to changes in settings.js
Update settings.js
 - replace `circulate()` function with internal `wrap: true`
 - move delay for menu redraw as suggested in espruino/Espruino#2149
 - beautify menu entries for new touchscreen E.showMenu system (> fw 2v.13.32)
2022-02-15 19:47:15 +01:00
storm64 f9be0db3c8 sleeplog: remove logging always, minimized workaround in settings menu
Update boot.js
 - remove logging always for testing
Update settings.js
 - minimized workaround in settings menu to [espruino/Espruino issue 2149](https://github.com/espruino/Espruino/issues/2149)
2022-02-14 08:18:16 +01:00
storm64 c8c1b7b914 sleeplog: Prevent removing other kill listeners #1445
Update boot.js
 - prevent removing other kill listeners #1445
Update README.md
 - change "only available" information for Settings
 - add new ideas to "To do list"
2022-02-13 22:39:57 +01:00
storm64 0ec1d57add sleeplog: Complete power saving mode + move all read/write log actions into lib.js
* Complete new power saving mode after tests
* Move all read/write log operations into lib/module
Update app.js
 - update `readLog(...)` call
Update boot.js
 - update maxmove default value
 - delete `log(..)`, merging into `writeLog(...)` from lib.js
 - replace all read/write actions to the logfile with `readLog(...)`/`writeLog(...)` from lib.js
 - add restoring the status after a restart (<5 min ago) to last known state
 - add deletion of unused settings on power saving mode
 - update log timestamp on power saving mode to always be 10min before now
Update ChangeLog
Update lib.js
 - update `readLog(...)`, prevent errors on reading, minimize workload if unfiltered
 - add `writeLog(...)` to append or replace log depending on input with plausibility checks on input
 - merging `log(...)` from boot.js into `writeLog(...)`
 - replace all read/write actions to the logfile with `readLog(...)`/`writeLog(...)`
Update metadata.json
 - update version number
 - add power saving mode to description
Update README.md
 - add power saving mode description
 - move sleeping/not worn decision description into its own section
 - add description for timestamp values to Logging section
 - update Global Object and Module Functions section
Update settings.js
 - update maxmove setting and default value
2022-02-13 20:54:26 +01:00
storm64 b8721fbdcf sleeplog: New power saving mode using build in movement detection
* New power saving mode using build in movement detection
Update app.js
 - add displaying powersaving status
Update boot.js
 - add power save mode
 - minimize fix #1425 to issue #1423
 - minimize wake/sleep decision
 - add checking for correct this reference
 - add checking for global object existence
 - remove unneeded global. prefix
Update lib.js
 - add powersaving setting to setEnabled()
 - fix missing logfile issue #1423 on all functions
 - remove check for changes in setEnabled(...) to always restart the service
Update settings.js
 - add settings powersaving and maxmove
 - add displaying settings depending on power saving mode
 - restart service when changing enabled, logfile and powersaving
2022-02-12 01:43:58 +01:00
Marco H 50b94d6870
Update boot.js
Fixes Uncaught Error: Expecting a string, got undefined
see https://github.com/espruino/BangleApps/issues/1423
2022-02-11 13:16:59 +01:00
storm64 02aeaff86b sleeplog: Add Sleep Log App
This app logs and displays the four following states:
_unknown, not worn, awake, sleeping_
It derived from the SleepPhaseAlarm and uses the accelerometer to estimate sleep and wake states with the principle of Estimation of Stationary Sleep-segments ([ESS](https://ubicomp.eti.uni-siegen.de/home/datasets/ichi14/index.html.en)) and the internal temperature to decide _sleeping_ or _not worn_ when the watch is resting.
2022-02-11 09:29:02 +01:00