mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 05:26:52 +03:00
Bugfix for time stamp (#3180)
* Update ClassFlowPostProcessing.cpp * Update ClassFlowDefineTypes.h * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update interface_webhook.cpp
This commit is contained in:
@@ -26,17 +26,13 @@ void WebhookInit(std::string _uri, std::string _apiKey)
|
||||
|
||||
void WebhookPublish(std::vector<NumberPost*>* numbers)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
cJSON *jsonArray = cJSON_CreateArray();
|
||||
|
||||
for (int i = 0; i < (*numbers).size(); ++i)
|
||||
{
|
||||
string timezw = "";
|
||||
char buffer[80];
|
||||
struct tm* timeinfo = localtime(&(*numbers)[i]->lastvalue);
|
||||
struct tm* timeinfo = localtime(&(*numbers)[i]->timeStampLastPreValue);
|
||||
strftime(buffer, 80, PREVALUE_TIME_FORMAT_OUTPUT, timeinfo);
|
||||
timezw = std::string(buffer);
|
||||
|
||||
@@ -85,8 +81,6 @@ void WebhookPublish(std::vector<NumberPost*>* numbers)
|
||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "HTTP request failed");
|
||||
}
|
||||
|
||||
|
||||
|
||||
esp_http_client_cleanup(http_client);
|
||||
cJSON_Delete(jsonArray);
|
||||
free(jsonString);
|
||||
@@ -125,4 +119,4 @@ static esp_err_t http_event_handler(esp_http_client_event_t *evt)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#endif //ENABLE_WEBHOOK
|
||||
#endif //ENABLE_WEBHOOK
|
||||
|
||||
Reference in New Issue
Block a user