EDGE Sleep Mode

These functions aren't called in an EDGE-based data field, when the device is put to sleep or wakes up from sleep. Either using the SLEEP Power Option. Or just letting it go to sleep by itself after a few minutes in STOPPED state.

Apparently a lot of users don't power off their EDGE device between workouts/rides. I've implemented a timer that does the trick for what I need to do. But it would be nice to be informed of the sleep state transition on EDGE devices. In case Garmin monitors this group. This isn't a bug. Just a feature request.

  • onEnterSleep() and onExitSleep() don't exist for the DataField class, which would explain why they don't get called in your case.

    As per the API documentation, onEnterSleep() and onExitSleep() are members of the WatchFace class, which obviously doesn't exist for Edge devices. They're called when low power mode is entered / exited for watch faces.

    This isn't a bug. Just a feature request.

    But you're still wording your post as if it would be reasonable for onEnterSleep() and onExitSleep() to be called for data fields. I don't think it would be, since those functions are not even defined for the DataField class.

    It would be like me complaining that onTimerReset() doesn't get called for a watch face, or something like that.

    In case Garmin monitors this group.

    You know there's a dedicated forum for CIQ bug reports, where people post feature requests all the time?

    Not that you can't post feature requests here, but why not also post in the bug report forum, if this is something you actually want?

    You've been here for years, you should have a pretty good idea of what kind of posts come to Garmin's attention outside of the bug reports forums (usually only major bugs), based on the posts that they actually reply to. (Ofc we have no idea which ones they're actually reading.)

  • IMHO in a datafield you need to use the DataField.onTimerX functions. 

  • I guess I would like those functions to be implemented for EDGE devices since they do go to sleep and wake up. I can't call those bugs. I thought there was a feature request forum, but I couldn't find it. Anyway, this is really low priority and I've solved my use case with a timer... Thanks

  • But what is the use case? The activity should be paused by the system before the user gets there (or at the time they hit sleep). Do I miss something?

  • You can kind of look at it like "resume later" when recording an activity on a watch.  The activity "sleeps", except the watch itself doesn't sleep to conserve battery.  When you resume, it "kind of" starts where it left off with the same recording but CIQ DFs can be confused.

    On some watches (va and venu) if you pause a recording more than something like 10-15 minutes, the activity is stopped and saved automatically with no way to resume it

  • I don’t know about other Edges, but I can’t put my Edge into sleep mode, unless I stop the timer first. The data field knows if the timer is stopped etc.

  • But when it resumes, do CIQ DF all have the same data as when the Edge went to sleep?  With some it doesn't matter as they always show the current data, but some have a history of things so far to calculate/display info

  • I've never really liked the name onEnterSleep and onExitSleep for watch faces, as there was a time where you could manually tell some watches you were going to bed.

    onEnterSleep and onExitSleep tell the watch faces when they enter/leave low power mode, where onUpdate is called either every second or every minute.

  • But when it resumes, do CIQ DF all have the same data as when the Edge went to sleep?

    Yes.

    I did a test on a Edge 1040: set a counter in onCompute(), which increases every second by 1, after the datafield was loaded. No activity has to be started. I waited until the display shows 60 (one minute after loading the datafield), then put it to sleep.
    Waited another 2 minutes and then I woke it up: counter continued with 60.

  • Here is what happens. Normally I expected users would Power Off their EDGE following a workout, until the next use. Upon Power On, I initiate a Server Fetch to get the new workout targets for the day's workout. What I found a lot of users do, is not actually turn off their EDGE. They let it auto sleep after 5 mins. The next day they wake it up and START a new workout. So their workout targets were not refreshed. I don't want to wait for a START to fetch - the targets should be ready before Starting the activity ideally. I've since implemented a fetch timestamp with re-fetch logic, so when the device wakes back up if the targets are stale I re-fetch - which would happen if it had been asleep for awhile. Everything is working fine now.