add: new commands to controller
This commit is contained in:
parent
b969ddd4ff
commit
dd9e533f22
12 changed files with 127 additions and 62 deletions
src/endpoints
|
@ -146,11 +146,7 @@ api_v1_schedules_STR_PUT(struct mg_connection *nc, struct http_message *hm, endp
|
|||
return;
|
||||
}
|
||||
|
||||
relay_t **relays = relay_get_with_schedule(schedule->id);
|
||||
for(int i = 0; relays[i] != NULL; ++i)
|
||||
{
|
||||
command_set_relay_schedule(relays[i]);
|
||||
}
|
||||
command_schedule_update(schedule);
|
||||
|
||||
cJSON *json_tag;
|
||||
cJSON *json_tags = cJSON_GetObjectItemCaseSensitive(json, "tags");
|
||||
|
@ -180,7 +176,6 @@ api_v1_schedules_STR_PUT(struct mg_connection *nc, struct http_message *hm, endp
|
|||
|
||||
endpoint_response_json(response, 200, json);
|
||||
cJSON_Delete(json);
|
||||
relay_free_list(relays);
|
||||
schedule_free(schedule);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue