Skip to main content

GetPowerOptions

Will return information about the power options of the device

Syntax​

Method ID​

#define WAAPI_MID_GET_POWER_OPTIONS 30007

JSON Input Structure​

{
"input": {
"method": 30007
}
}

Input Properties​

This method does not require any additional parameters beyond the method ID.

JSON Output Structure​

{
"result": {
"method": 30007,
"code": number,
"timing": number,
"timestamp": string,
"on_battery": boolean,
"screen_off_timeout": number,
"sleep_timeout": number,
"screen_saver": {
"timeout": number,
"is_secure": boolean
},
"required_password_timeout": number
}
}

Output Properties​

PropertyTypeDescription
result.methodnumberThe method ID that generated this result.
result.codenumberThe result code. See Result Codes.
result.timingnumberThe measured time for the method call in milliseconds.
result.timestampstringThe timestamp in seconds of when the call was made.
result.on_batteryboolean(optional) Indicates the device is using battery.
(Linux) Support GNOME, Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.screen_off_timeoutnumber(optional) Timeout to turn off screen in seconds.
(Linux) Support Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.sleep_timeoutnumber(optional) Timeout to sleep device in seconds.
(Linux) Support GNOME, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.screen_saverobject(optional) Detail information of screen_saver.
(Linux) Support GNOME, Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.screen_saver.timeoutnumber(optional) Timeout to enter screen saver mode in seconds.
(Linux) Support GNOME, Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.screen_saver.is_secureboolean(optional) Require login after entering screen saver mode.
(Windows) Supported.
(macOS) Support only for macOS Big Sur and later.
(Linux) Support GNOME, Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only
result.required_password_timeoutnumber(optional) (macOS, Linux only) Timeout to require login after sleep or screen saver begins (0: never, -1: immediate, >0: number of seconds). (macOS) Support only for macOS Big Sur and later. Only show when getting info successfully.
(Linux) Support GNOME, Cinnamon, KDE Plasma and Xfce4 (with Light Locker disabled) only

Result Codes​

CodeNameDescription
0WAAPI_OKThe operation completed successfully.
note

Other codes may be returned. See the full Result Codes reference for the complete list.

Remarks​

Error Handling​

The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.

Examples​

Examples will be added here demonstrating the usage of this method.

See Also​


Last updated: 2026-10-01