Turning backlight on from a watch face.

Former Member
Former Member
Hello, should this be possible from within a watch face?

//! The user has just looked at their watch. Timers and animations may be started here.
function onExitSleep() {
Toybox.System.println("exit sleep");
Toybox.Attention.backlight(true);
}

//! Terminate any active timers and prepare for slow updates.
function onEnterSleep() {
Toybox.System.println("enter sleep");
Toybox.Attention.backlight(false);
}


It doesn't work for me. I get:

enter sleep
Permission required
Permission Required
Failed invoking <symbol>
Complete
Connection Finished
Closing shell and port


I don't think the Attention module needs any premissions.
Any ideas?
  • You correct that the Attention module does not have permissions that can be enabled. The issue here is that the Attention module is not available to watch faces (see the APIs and App Types section in the Programmer's Guide). Some products have added a backlight-on-gesture feature at the firmware level. For example, the Forerunner 630 has a Wrist Turn back light setting that will activate the back light when someone turns their wrist to check the time.
  • Former Member
    Former Member over 9 years ago
    Using the drawing context

    Thank you, Brandon. That's a reasonable design decision.

    I have another question: how do I update the screen contents from those two methods? They don't give me access to dc (drawing context). They say an animation should be started there, but I think I don't have an example of this in the SDK examples.