Confused about sleep mode/dnd

Hi guys,

I am a little bit confused about the difference between sleep mode and dnd. The simulator allows it to set sleep mode on and also activate dnd. Via API dnd is exposed but for isSleepMode there is a deprecation tag. Does that mean that with CIQ 4.0 isSleepMode will be removed and together with that also the setting in the simulator? And does that mean that in the future (or now already) dnd is activated automatically when the configured sleep time starts?

basic question: what is checked by the Garmin watchfaces when showing the "sleep" icon?

Thanks!

Bye
  • In the sim, for watch faces, onEnterSleep() onExitSleep() are used to detect what is commonly referred to entering and leaving low power mode. With a watchface in low power mode, onUpdate() is only called once a minute. For 10 seconds after a gesture the watch face leave low power mode and, onUpdate is called every second. To know what state your in, onEnterSleep() and onExitSleep() are called. So these calls actually have nothing to do with sleeping.

    isSleepMode() is about actual going to bed and sleeping. There are only a couple of devices yo can get in this mode - the vivoactive and f3, for example.

    Do Not Disturb on some devices can be set to turn on and off based on configured sleep times. But can also be turned on at times outside of that.
  • In the sim, for watch faces, onEnterSleep() onExitSleep() are used to detect what is commonly referred to entering and leaving low power mode. With a watchface in low power mode, onUpdate() is only called once a minute. For 10 seconds after a gesture the watch face leave low power mode and, onUpdate is called every second. To know what state your in, onEnterSleep() and onExitSleep() are called. So these calls actually have nothing to do with sleeping.

    isSleepMode() is about actual going to bed and sleeping. There are only a couple of devices yo can get in this mode - the vivoactive and f3, for example.

    Do Not Disturb on some devices can be set to turn on and off based on configured sleep times. But can also be turned on at times outside of that.


    Yes, I am aware about the first part with "onEnterSleep" and "onExitSleep", my confusion is about the 2 other points. From what I understood from your statement is that there is a basic difference between sleep mode (where user actually sleeps) and DND. This means that there must be a way to determine both states. As I wrote above there is a property in SDK "doNotDisturb" which is supported and works, but the property "isSleepMode" is deprecated, so what is the best way to determine if the user is currently sleeping or not? I have implemented this code block to check if the current moment is within the sleeping yours:

    var oSleepTime = oProfile.sleepTime;
    var oWakeTime = oProfile.wakeTime;
    var oNow = Time.now();
    var oToday = Time.today();

    if (oNow.greaterThan(oToday.add(oSleepTime)) && oNow.smallerThan(oToday.add(oWakeTime))) {
    ..........
    }


    but I guess there must be an easier way to find out.

    Thanks!

    Bye
  • To see configured sleep times, you use the profile. That's how I've been doing the sleep icon on WFs for quite some time.
  • To see configured sleep times, you use the profile. That's how I've been doing the sleep icon on WFs for quite some time.


    Ok, so my solution above is the way to go. Thanks!

    Bye