# Class Power#enableAllOnTimer

Power

- Defined in: power.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Power#enableAllOnTimer(successCallback, errorCallback, options) Controls all "on timer".

## Class Detail

Power#enableAllOnTimer(successCallback, errorCallback, options)
Controls all "on timer". This API enables/disables all "on timer" at once. Values of each "on timer" which was set by Power.addOnTimer() are not changed when option.clearOnTimer is false.

    // Javascript code
    function enableAllOnTimer () {
      var options = {
         allOnTimer : true
      };

      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.enableAllOnTimer(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object} options

  Property | Type | Description | Required
  --- | --- | --- | ---
  allOnTimer | Boolean | true : enabled / false : disabled | required
  clearOnTimer | Boolean | true : removes all "on Timer" / false : do nothing. (default) | optional

Since:
  1.0, 1.3 optons.clearOnTimer
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.getPowerStatus()