Class Power#addOnTimer

Power

Class Summary
Constructor Attributes Constructor Name and Description
 
Power#addOnTimer(successCallback, errorCallback, options)
Adds 'on timer'.

Class Detail

Power#addOnTimer(successCallback, errorCallback, options)
Adds 'on timer'.
// Javascript code
function addOnTimer () {
  var options = {
     hour : 9,
     minute : 0,
     week : Power.TimerWeek.MONDAY + Power.TimerWeek.FRIDAY,
     inputSource : "ext://hdmi:1"
  };
    
  function successCb() {
     // Do something
  }

  function failureCb(cbObject) {
     var errorCode = cbObject.errorCode;
     var errorText = cbObject.errorText;
     console.log ("Error Code [" + errorCode + "]: " + errorText);
  }

  var power = new Power();
  power.addOnTimer(successCb, failureCb, options);
}
Parameters:
{Function} successCallback
success callback function.
{Function} errorCallback
failure callback function.
{Object} options
PropertyTypeDescriptionRequired
hourNumberhour (0~23)required
minuteNumberminute (0~59)required
weekNumberweek Power.TimerWeek
To use it on multiple days of week, set the sum of week.
For example, 1 + 64 (Power.TimerWeek.Monday + Power.TimerWeek.Sunday) means that this timer works on every Monday and Sunday.
week: 0 is repeat: none (timer is working only 1 time).
required
inputSourceStringDefine the input source. ext://[externalInput]:[portNum]. (eg: "ext://hdmi:1")required
Since:
1.0, 1.3 add week:0
Returns:

If the method is successfully executed, success callback function is called without a parameter.
If an error occurs, failure callback function is called with failure callback object as a parameter.

See:
Power.getOnTimerList(), InputSource.getInputSourceStatus()