2022-12-14 22:37:37 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2022-10-27 10:38:52 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-11-10 19:28:48 +01:00
|
|
|
#include <ESPAsyncWebServer.h>
|
2022-12-14 22:13:03 +01:00
|
|
|
#include <Hoymiles.h>
|
2022-10-27 10:38:52 +02:00
|
|
|
|
|
|
|
|
class WebApiPrometheusClass {
|
|
|
|
|
public:
|
|
|
|
|
void init(AsyncWebServer* server);
|
|
|
|
|
void loop();
|
|
|
|
|
|
|
|
|
|
private:
|
2022-11-10 19:51:01 +01:00
|
|
|
void onPrometheusMetricsGet(AsyncWebServerRequest* request);
|
2022-10-27 10:38:52 +02:00
|
|
|
|
2023-02-06 19:51:10 +01:00
|
|
|
void addField(AsyncResponseStream* stream, String& serial, uint8_t idx, std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId, const char* channelName = NULL);
|
2022-10-27 10:38:52 +02:00
|
|
|
|
|
|
|
|
AsyncWebServer* _server;
|
|
|
|
|
};
|