Set sleep policy
1. API Description
This API is used to set the sleep policy of the device.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/general/set-goto-sleep
- V2.5.0 and below: POST [ip]/mwapi/set-goto-sleep
| Administrator Rights | Logged-in | 
|---|---|
| No | Yes | 
2. Input Parameters
| Name | Required | Type | Description | 
|---|---|---|---|
| gotoSleep | Yes | Int | The sleep mode of the device. 0: Never 1: Go to sleep after 30 minutes 2: Go to sleep after 1 hour 3: Go to sleep after 2 hours 4: Go to sleep after 4 hours 5: Go to sleep after 8 hours 6:Go to sleep after 12 hours | 
3. Output Parameters
| Name | Type | Description | 
|---|---|---|
| status | Int | Status code | 
4. Example
Setting the device going to sleep after 30 minutes of inactivity.
Input Example
{
    "goToSleep":1
}
Output Example
{
  "status": 0,
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Status | Definition | Description | 
|---|---|---|
| 49 | MW_STATUS_INVALID_DATA | The parameters are missing or incorrect |