mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-11 09:25:41 +00:00
stub for Tasmota http commands interface
This commit is contained in:
@ -892,6 +892,32 @@ int http_fn_cfg_ha(http_request_t *request) {
|
||||
poststr(request, NULL);
|
||||
return 0;
|
||||
}
|
||||
// https://tasmota.github.io/docs/Commands/#with-mqtt
|
||||
/*
|
||||
http://<ip>/cm?cmnd=Power%20TOGGLE
|
||||
http://<ip>/cm?cmnd=Power%20On
|
||||
http://<ip>/cm?cmnd=Power%20off
|
||||
http://<ip>/cm?user=admin&password=joker&cmnd=Power%20Toggle
|
||||
*/
|
||||
// https://www.elektroda.com/rtvforum/viewtopic.php?p=19330027#19330027
|
||||
// Web browser sends: GET /cm?cmnd=POWER1
|
||||
// System responds with state
|
||||
int http_fn_cm(http_request_t *request) {
|
||||
char tmpA[128];
|
||||
|
||||
http_setup(request, httpMimeTypeJson);
|
||||
if( http_getArg(request->url,"cmd",tmpA,sizeof(tmpA))) {
|
||||
//CMD_ExecuteCommand(
|
||||
|
||||
|
||||
|
||||
}
|
||||
poststr(request,"{\"POWER1\":\"OFF\"}");
|
||||
poststr(request, NULL);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int http_fn_cfg(http_request_t *request) {
|
||||
int i,j,k;
|
||||
|
||||
@ -25,3 +25,4 @@ int http_fn_ota_exec(http_request_t *request);
|
||||
int http_fn_ota(http_request_t *request);
|
||||
int http_fn_empty_url(http_request_t *request);
|
||||
int http_fn_other(http_request_t *request);
|
||||
int http_fn_cm(http_request_t *request);
|
||||
|
||||
@ -527,6 +527,7 @@ int HTTP_ProcessPacket(http_request_t *request) {
|
||||
|
||||
if(http_checkUrlBase(urlStr,"ota")) return http_fn_ota(request);
|
||||
if(http_checkUrlBase(urlStr,"ota_exec")) return http_fn_ota_exec(request);
|
||||
if(http_checkUrlBase(urlStr,"cm")) return http_fn_cm(request);
|
||||
|
||||
return http_fn_other(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user