Added additional field to the prometheus api which identifies a channel by it's type. That means that e.g. channel 0 exists for type AC and DC. This commit also introduces a additional field in the statistics byte assignment table. This field identifies whether a channel is on the AC or DC side. MQTT and WebAPI is still compatible with the previous design.
18 lines
524 B
C++
18 lines
524 B
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#pragma once
|
|
|
|
#include <ESPAsyncWebServer.h>
|
|
#include <Hoymiles.h>
|
|
|
|
class WebApiPrometheusClass {
|
|
public:
|
|
void init(AsyncWebServer* server);
|
|
void loop();
|
|
|
|
private:
|
|
void onPrometheusMetricsGet(AsyncWebServerRequest* request);
|
|
|
|
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);
|
|
|
|
AsyncWebServer* _server;
|
|
}; |