AbstractPowerService

AbstractPowerService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Mixes: MObjectStates
Service:
Properties

NameTypeDescription
rcuPowerStateChangeHandledByDeviceboolean

flag to tell if RCU_POWER should be manage by UI or MIDW (default: false)

AbstractPowerService()

The PowerService manage the power state of the device.

init() ⇒ Promise

Initialize the power service

Kind: instance method of AbstractPowerService
Returns: Promise - A Promise resolved when the power service is initialized.

getPowerState() ⇒ Promise.<number>

Return the current state of the power.

Kind: instance method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved with the current power state.

setPowerState(state) ⇒ Promise.<number>

Change the power state. Fires the onStateChange event if the state has actually changed.

Kind: instance method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved when the power status has actually changed.
Emits: AbstractPowerService#event:stateChange

ParamTypeDescription
statenumber

(integer) - one of POWER_STATE_LOW, POWER_STATE_STAND_BY, POWER_STATE_ON

wakeUp() ⇒ Promise.<AbstractPowerService>

Wake up the box

Kind: instance method of AbstractPowerService
Returns: Promise.<AbstractPowerService> - A Promise resolved when the power status has actually changed.

standby() ⇒ Promise.<AbstractPowerService>

Standby the box

Kind: instance method of AbstractPowerService
Returns: Promise.<AbstractPowerService> - A Promise resolved when the power status has actually changed.

reboot() ⇒ Promise.<number>

Reboot the box

Kind: instance method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved when the command is sending to the box.

getSleepModeTimer() ⇒ Promise.<number>

Get the sleep mode timer of the front panel

Kind: instance method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved with the sleepModeTimer value.

setSleepModeTimer(sleepModeTimer) ⇒ Promise.<state>

Set the sleep mode timer of the front panel

Kind: instance method of AbstractPowerService
Returns: Promise.<state> - A Promise resolved when the sleepModeTimer is setted.
Emits: AbstractUserSettingsService#event:preferredSleepModeTimerChange

ParamType
sleepModeTimernumber

getAvailableLowStateModeTimerValues() ⇒ Promise.<Array.<Number>>

Allows to retrieve available delay values for the MIDW to go to deep standby after standby

Kind: instance method of AbstractPowerService
Returns: Promise.<Array.<Number>> - List of delay values in ms

getLowStateModeTimer() ⇒ Promise.<Number>

Allows to retrieve current delay value for the MIDW to go to deep standby after standby

Kind: instance method of AbstractPowerService
Returns: Promise.<Number> - Delay value in ms

setLowStateModeTimer(value) ⇒ Promise

Allows to set delay value for the MIDW to go to deep standby after standby

Kind: instance method of AbstractPowerService

ParamTypeDescription
valuenumber

Delay value in ms

factoryReset() ⇒ *

Reset data to factory settings

Kind: instance method of AbstractPowerService

getFirstInstallDone() ⇒ Promise.<boolean>

Allows to get first install done flag

Kind: instance method of AbstractPowerService

setFirsInstallDone() ⇒ Promise

Allows to set first install done flag

Kind: instance method of AbstractPowerService

_onUpcomingStandby(duration) ⇒ Promise

Kind: instance method of AbstractPowerService
Emits: event:#upcomingStandby
Access: protected

ParamTypeDescription
durationNumber

duration in seconds before standby

_onPowerStateChanged(state) ⇒ Promise

Kind: instance method of AbstractPowerService
Emits: event:#powerStateChanged
Access: protected

ParamTypeDescription
stateNumber

the new state

_init() ⇒ Promise

Initialize the power service

Kind: instance method of AbstractPowerService
Returns: Promise - A Promise resolved when the power service is initialized.

_getPowerState() ⇒ Promise.<number>

Gets the current power state from the middleware.

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved with the current power state.

_setPowerState(state) ⇒ Promise

Change the power status.

Kind: instance abstract method of AbstractPowerService
Returns: Promise - A Promise resolved when the power status has actually changed.

ParamType
statenumber

_wakeUp() ⇒ Promise.<AbstractPowerService>

Wake up the box

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<AbstractPowerService> - A Promise resolved when the power status has actually changed.

_standby() ⇒ Promise.<AbstractPowerService>

Standby the box

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<AbstractPowerService> - A Promise resolved when the power status has actually changed.

_reboot() ⇒ Promise.<number>

Reboot the box

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<number> - A Promise resolved when the command is sending to the box.

_factoryReset() ⇒ Promise.<boolean, Error>

Vendor implementation to reset the box with default factory

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<boolean, Error> - A Promise resolved when the command has been done successfully

_getSleepModeTimer() ⇒ Promise.<number>

Get the sleep mode timer

Kind: instance abstract method of AbstractPowerService

_setSleepModeTimer(sleepModeTimer) ⇒ Promise

Get the sleep mode timer

Kind: instance abstract method of AbstractPowerService

ParamType
sleepModeTimernumber

_getAvailableLowStateModeTimerValues() ⇒ Promise.<Array.<Number>>

Allows to retrieve available delay values for the MIDW to go to deep standby after standby

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<Array.<Number>> - List of delay values in ms

_getLowStateModeTimer() ⇒ Promise.<Number>

Allows to retrieve current delay value for the MIDW to go to deep standby after standby

Kind: instance abstract method of AbstractPowerService
Returns: Promise.<Number> - Delay value in ms

_setLowStateModeTimer(value) ⇒ Promise

Allows to set delay value for the MIDW to go to deep standby after standby

Kind: instance abstract method of AbstractPowerService

ParamTypeDescription
valuenumber

Delay value in ms

_getFirstInstallDone() ⇒ Promise.<boolean>

Allows to get first install done flag

Kind: instance abstract method of AbstractPowerService

_setFirsInstallDone() ⇒ Promise

Allows to set first install done flag

Kind: instance abstract method of AbstractPowerService

“upcomingStandby” (duration)

Fired when the auto standby timer is close to end. First param of event is the duration before timer end

Kind: event emitted by AbstractPowerService

ParamTypeDescription
durationNumber

duration in seconds before standby

“powerStateChanged” (state)

Fired when the powerState have been changed.

Kind: event emitted by AbstractPowerService

ParamTypeDescription
stateNumber

the new state

STATE_LOW : number

Application is closed

Kind: static constant of AbstractPowerService
Default: 0

STATE_STAND_BY : number

Screen is disabled and application is enabled

Kind: static constant of AbstractPowerService
Default: 0

STATE_ON : number

Application is enabled and screen is enabled

Kind: static constant of AbstractPowerService
Default: 2

STATE_REBOOT : number

Device/Application currently reboot

Kind: static constant of AbstractPowerService
Default: 3

STATE_FACTORY_RESET : number

Device/Application currently reboot

Kind: static constant of AbstractPowerService
Default: 3

STATES : Array.<string>

Application states

Kind: static constant of AbstractPowerService
Default: ["STATE_LOW", "STATE_STAND_BY", "STATE_ON"]