Skip to content

Commit

Permalink
Fix #1960: Prometheus API return wrong information in function addPan…
Browse files Browse the repository at this point in the history
…elInfo
  • Loading branch information
tbnobody committed May 4, 2024
1 parent d5a2490 commit 7d2fb34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/WebApi_prometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, const Stri
return;
}

const CONFIG_T& config = Configuration.get();
const auto& config = Configuration.getInverterConfig(inv->serial());

const bool printHelp = (idx == 0 && channel == 0);
if (printHelp) {
Expand All @@ -155,7 +155,7 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, const Stri
idx,
inv->name(),
channel,
config.Inverter[idx].channel[channel].Name);
config->channel[channel].Name);

if (printHelp) {
stream->print("# HELP opendtu_MaxPower panel maximum output power\n");
Expand All @@ -166,7 +166,7 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, const Stri
idx,
inv->name(),
channel,
config.Inverter[idx].channel[channel].MaxChannelPower);
config->channel[channel].MaxChannelPower);

if (printHelp) {
stream->print("# HELP opendtu_YieldTotalOffset panel yield offset (for used inverters)\n");
Expand All @@ -177,5 +177,5 @@ void WebApiPrometheusClass::addPanelInfo(AsyncResponseStream* stream, const Stri
idx,
inv->name(),
channel,
config.Inverter[idx].channel[channel].YieldTotalOffset);
config->channel[channel].YieldTotalOffset);
}

0 comments on commit 7d2fb34

Please sign in to comment.