The goal would be to be used by apps that run in the background too such as activityreminer, sleepphasealarm, sleeplog, ect.
The need for the previous state would be to know if it can go from one state to another. It makes no sens to go directly from "sport" to "deepsleep" for example.
I do understand that isWorn is good as module and I could improve on it to add the HRM stuff but but more complex states I am not sure it's the right approach.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The goal would be to be used by apps that run in the background too such as activityreminer, sleepphasealarm, sleeplog, ect.
The need for the previous state would be to know if it can go from one state to another. It makes no sens to go directly from "sport" to "deepsleep" for example.
I do understand that isWorn is good as module and I could improve on it to add the HRM stuff but but more complex states I am not sure it's the right approach.