timerSet method
timerSet
-> /v1/timer/{id}
Sets the details of the specified timer.
PARAMETERS
id
(required) :
The ID of the timer, either name, index or UUID.
- Example (by_name):
Timer Name
- Example (by_index):
3
- Example (by_uuid):
3C39C433-5C18-4F51-B357-55BB870227C4
postBody
(required) : This is the data that must be sent with this request.
Example (set_configuration_countdown):
{
"id": {
"uuid": "942C3FC3-C4B2-44F7-A55D-4CC913BB8A5D",
"name": "Timer 1",
"index": 0
},
"allows_overrun": true,
"countdown": {
"duration": 300
}
}
Example (set_configuration_countdown_to_time):
{
"id": {
"uuid": "942C3FC3-C4B2-44F7-A55D-4CC913BB8A5D",
"name": "Timer 1",
"index": 0
},
"allows_overrun": true,
"count_down_to_time": {
"time_of_day": 3600,
"period": "pm"
}
}
Example (set_configuration_elapsed):
{
"id": {
"uuid": "942C3FC3-C4B2-44F7-A55D-4CC913BB8A5D",
"name": "Timer 1",
"index": 0
},
"allows_overrun": true,
"elapsed": {
"start_time": 0,
"end_time": 120
}
}
RESPONSE 200:
The request was processed successfully.
content-type: application/json
schema:
{
"oneOf": [
{
"type": "object",
"required": [
"id",
"allows_overrun"
]
},
{
"type": "object",
"required": [
"id",
"allows_overrun"
]
},
{
"type": "object",
"required": [
"id",
"allows_overrun"
]
}
]
}
RESPONSE 400:
The request was not valid.
content-type: ``
Implementation
Future<Map<String, dynamic>> timerSet(String id, String postBody) async {
String url = '/v1/timer/$id';
return await call('put', url, httpAccept: 'application/json');
}