Tuyamcu raw access (#1048)

* working/?

* winnermicro fix

* ENABLE_DRIVER_TUYAMCU fx

* some fixes, some unfiished

* extra check
This commit is contained in:
openshwprojects
2024-01-24 11:18:29 +01:00
committed by GitHub
parent 717c9081d7
commit 55e2a66f7d
10 changed files with 218 additions and 2 deletions

View File

@ -744,6 +744,9 @@ static int http_tasmota_json_status_generic(void* request, jsonCb_t printer) {
return 0;
}
// drv_tuyaMCU.c
int http_obk_json_dps(int id, void* request, jsonCb_t printer);
int JSON_ProcessCommandReply(const char* cmd, const char* arg, void* request, jsonCb_t printer, int flags) {
int i;
@ -1027,6 +1030,20 @@ int JSON_ProcessCommandReply(const char* cmd, const char* arg, void* request, js
else if (!wal_strnicmp(cmd, "Ch", 2)) {
http_obk_json_channels(request, printer);
}
#ifndef OBK_DISABLE_ALL_DRIVERS
#if ENABLE_DRIVER_TUYAMCU
else if (!wal_strnicmp(cmd, "Dp", 2)) {
int id = -1;
if (isdigit(cmd[2])) {
sscanf(cmd + 2, "%i", &id);
}
http_obk_json_dps(id,request, printer);
if (flags == COMMAND_FLAG_SOURCE_MQTT) {
MQTT_PublishPrinterContentsToStat((struct obk_mqtt_publishReplyPrinter_s*)request, "DP");
}
}
#endif
#endif
else {
printer(request, "{");
printer(request, "}");