Forces the screen to turn off and puts the device to sleep.

app.GoToSleep()

(This has the same effect as pressing the power button)

See Also: WakeUp

Example - Sleep and Wake click to expand contents