lib/devices.js
function turnOff(device) {
    return api.request('/device/turnOff?' + querystring.stringify({id: device.id || device}));
  }
function turnOff(device) {
    return api.request('/device/turnOff?' + querystring.stringify({id: device.id || device}));
  }
function turnOff ( device ) { return api . request ( '/device/turnOff?' + querystring . stringify ( { id : device . id || device } ) ) ; }
Turns a device on
@param device either {id: anId} or anId
@returns {*} a Promise
Turns a device on