# Class Power#getPowerStatus

Power

- Defined in: power.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Power#getPowerStatus(successCallback, errorCallback) Gets power status

## Class Detail

Power#getPowerStatus(successCallback, errorCallback)
Gets power status

    // Javascript code
    function getPowerStatus () {
      function successCb(cbObject) {
         console.log("cbObject : " + JSON.stringify(cbObject));
         console.log("wakeOnLan : " + cbObject.wakeOnLan);
         console.log("displayMode : " + cbObject.displayMode);
         console.log("allOnTimer : " + cbObject.allOnTimer);
         console.log("allOffTimer : " + cbObject.allOffTimer);

         // Do something
            ...
      }

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

      var power = new Power();
      power.getPowerStatus(successCb, failureCb);
    }

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

Since:
  1.0
Returns:

  {Object}

  Property | Type | Description
  --- | --- | ---
  wakeOnLan | Boolean | true : enabled / false : disabled
  displayMode | String | Power.DisplayMode.DISPLAY_ON | Power.DisplayMode.DISPLAY_OFF
  allOnTimer | Boolean | true : enabled / false : disabled
  allOffTimer | Boolean | true : enabled / false : disabled

See:
  Power.setWakeOnLan(), Power.setDisplayMode()