Skip to main content
Version: 8.0.3

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();

getProprietaryTimers()

The getProprietaryTimers() method returns a list of currently set proprietary timers.

getProprietaryTimers(): Promise<IProprietaryTimer[]>;

Example

const timers = await sos.management.power.getProprietaryTimers();

getTimers()

The getTimers() method returns a list of currently set native timers.

getTimers(): Promise<ITimer[]>;

Example

const timers = await sos.management.power.getTimers();

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>;

Params

NameTypeDescription
typeTIMER_${number}The type of the timer (TIMER_1, ..., TIMER_7).
timeOnstring | nullThe time when the device should turn on.
timeOffstring | nullThe time when the device should turn off.
weekdaysstring[]The days of the week when the timer should be active (mon, ..., sun).
keepAppletRunning (optional)booleanIf true, the applet will be kept running when the timer is active on certain devices.

Example

await sos.management.power.setProprietaryTimer("TIMER_20", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);

setTimer()

The setTimers() method creates or updates a native timer.

setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: string[], volume: number): Promise<void>;

Params

NameTypeDescription
type"TIMER_1" | "TIMER_2" | "TIMER_3" | "TIMER_4" | "TIMER_5" | "TIMER_6" | "TIMER_7"The type of the timer (TIMER_1, ..., TIMER_7).
timeOnstring | nullThe time when the device should turn on.
timeOffstring | nullThe time when the device should turn off.
weekdaysstring[]The days of the week when the timer should be active (mon, ..., sun).
volumenumberThe volume level set when the device is turned on.

Example

await sos.management.power.setTimer("TIMER_1", "08:00", "22:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);

systemReboot()

The systemReboot() method initializes a system reboot.

systemReboot(): Promise<void>;

Example

await sos.management.power.systemReboot();

unsetProprietaryTimer()

The unsetProprietaryTimer() method removes the specified proprietary timer.

unsetProprietaryTimer(type: ProprietaryTimerType): Promise<void>;

Params

NameTypeDescription
typeTIMER_${number}The type of the timer (TIMER_1, ..., TIMER_7).

Example

await sos.management.power.unsetProprietaryTimer("TIMER_2");

unsetTimer()

The unsetTimer() method removes the specified native timer.

unsetTimer(type: keyof typeof TimerType): Promise<void>;

Params

NameTypeDescription
type"TIMER_1" | "TIMER_2" | "TIMER_3" | "TIMER_4" | "TIMER_5" | "TIMER_6" | "TIMER_7"The type of the timer (TIMER_1, ..., TIMER_7).

Example

await sos.management.power.unsetTimer("TIMER_2");