power
The sos.management.power
API groups together methods related to the power state of the device. Such as rebooting, shutting down,
setting timers.
Methods
appRestart()
The appRestart()
method initializes a restart of the signageOS app.
appRestart(): Promise<void>;
Example
await sos.management.power.appRestart();
clearScheduledReboots()
Removes all scheduled reboot rules from the device.
clearScheduledReboots(): Promise<void>;
Example
await sos.management.power.clearScheduledReboots();
getProprietaryTimers()
The getProprietaryTimers()
method returns a list of currently set
proprietary timers.
getProprietaryTimers(): Promise<IProprietaryTimer[]>;
Example
const timers = await sos.management.power.getProprietaryTimers();
getScheduledReboots()
Returns all scheduled reboot rules on the device.
getScheduledReboots(): Promise<IScheduledRebootActions[]>;
Example
await sos.management.power.getScheduledReboots();
getTimers()
The getTimers()
method returns a list of currently set native timers.
getTimers(): Promise<ITimer[]>;
Example
const timers = await sos.management.power.getTimers();
removeScheduledReboot()
Removes scheduled reboot rule from the device.
removeScheduledReboot(id: string): Promise<void>;
Params
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | - ID of the rule to be removed. |
Example
// Get scheduled reboots
const scheduledReboots = await sos.management.power.getScheduledReboots();
// Remove scheduled reboot
await sos.management.power.removeScheduledReboot(scheduledReboots[0].id);
setProprietaryTimer()
The setProprietaryTimer()
method creates or updates a
proprietary timer.
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: string[], keepAppletRunning?: boolean): Promise<void>;