Methods
getTask(id, callbackopt) → {Promise}
Get a specific task belonging to this app.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | string | ID of the task (must be lowercase, alphanumeric). | ||||||||||
| callback | function | <optional> | 
 | 
Returns:
- Type:
- 
        
Promise
getTasks(callbackopt) → {Promise}
Get all tasks belonging to this app.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| callback | function | <optional> | 
 | 
Returns:
- Type:
- 
        
Promise
registerTask(id, when, data, callbackopt) → {Promise}
Create a task.
Parameters:
| Name | Type | Attributes | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | string | ID of the task (must be lowercase, alphanumeric). | ||||||||||
| when | Date|String | The run date or interval. When provided a Date, the task will run once and automatically unregister. When provided a string in the cron-format (e.g.  | ||||||||||
| data | Object | |||||||||||
| callback | function | <optional> | 
 | 
Returns:
- Type:
- 
        
Promise
unregisterAllTasks(callbackopt) → {Promise}
Unregister all tasks.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| callback | function | <optional> | 
 | 
Returns:
- Type:
- 
        
Promise
unregisterTask(id, callbackopt) → {Promise}
Unregister a specific task.
Parameters:
| Name | Type | Attributes | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| id | string | ID of the task (must be lowercase, alphanumeric). | |||||||
| callback | function | <optional> | 
 | 
Returns:
- Type:
- 
        
Promise
 You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››
      You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››