Added errlog, custom http headers

This commit is contained in:
Magnus Persson
2022-01-27 14:00:12 +01:00
parent b106ebfa20
commit 63fd80e750
23 changed files with 411 additions and 187 deletions

View File

@ -26,14 +26,23 @@ SOFTWARE.
#include <templating.hpp>
#if defined(ESP8266)
#include <ESP8266HTTPClient.h>
#else // defined (ESP32)
#include <HTTPClient.h>
#endif
class PushTarget {
private:
uint32_t _ms; // Used to check that we do not post to often
bool _memErrorReported =
false; // Avoid filling the error log with memory errors.
void sendBrewfather(TemplatingEngine& engine);
void sendHttp(TemplatingEngine& engine, int index);
void sendInfluxDb2(TemplatingEngine& engine);
void sendMqtt(TemplatingEngine& engine);
void addHttpHeader(HTTPClient& http, String header);
public:
PushTarget() { _ms = millis(); }