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:
michael
2024-08-24 13:19:21 +02:00
committed by GitHub
parent c9a3df4eec
commit f8eb4db171
3 changed files with 29 additions and 32 deletions

View File

@@ -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