power module
Core framework Console Desktop
The power module provides access to the Windows power management
| Event | Description |
|---|---|
| power.onBatteryLow() | Event fired when battery is low |
| power.onPlugged() | Event fired when the power source has changed |
| power.onResume() | Event fired when computer is resumed |
| power.onSuspend() | Event fired when computer is going to be suspended |
| Property | Description | Access | Type |
|---|---|---|---|
| power.battery | Get current battery status | readonly | table nil |
| power.plugged | Check if the computer is plugged to AC | readonly | boolean |
| Functions | Description | Return value |
|---|---|---|
| power.displayoff() | Turns off the monitor | - |
| power.hibernate() | Suspends the computer in hibernation mode | boolean |
| power.hold() | Prevents the computer from going into sleep mode | boolean |
| power.sleep() | Suspends the computer in sleep mode | boolean |
| power.unhold() | Permits the computer to go to sleep | boolean |