# Class Power#setOnOffTimeSchedule

Time

- Defined in: power.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Power#setOnOffTimeSchedule(successCallback, errorCallback, options) Sets On/Off time schedule

## Class Detail

Power#setOnOffTimeSchedule(successCallback, errorCallback, options)
Sets On/Off time schedule

    // Javascript code
     function setOnOffTimeSchedule () {
         var params = {
              "onOffTimeSchedule":[
                  {
                      "day":"fri",
                      "onTime":{
                          "hour":12,
                          "minute":0
                      },
                      "offTime":{
                          "hour":21,
                          "minute":0
                      }
                  },
                  {
                      "day":"mon",
                      "onTime":{
                          "hour":7,
                          "minute":0
                      },
                      "offTime":{
                          "hour":18,
                          "minute":0
                      }
                  }
              ]
         }
         function successCb(cbObject) {
             console.log("success");
             // Do something
         }
         function failureCb(cbObject) {
             var errorCode = cbObject.errorCode;
             var errorText = cbObject.errorText;
             console.log ("Error Code [" + errorCode + "]: " + errorText);
         }
         var power = new Power();
         power.setOnOffTimeSchedule(successCb, failureCb, params);
     }

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

  Property | Type | Description
  --- | --- | ---
  onOffTimeSchedule[] | Array | on/Off Time Schedule list
  onOffTimeSchedule[].day | String | day
  onOffTimeSchedule[].onTime.hour | Number | onTime hour
  onOffTimeSchedule[].onTime.minute | Number | onTime minute
  onOffTimeSchedule[].offTime.hour | Number | offTime hour
  onOffTimeSchedule[].offTime.minute | Number | offTime minute

Since:
  1.5
See:
  Power.getOnOffTimeSchedule()
  Power.unsetOnOffTimeSchedule()