diff --git a/esphome/components/prometheus/prometheus_handler.cpp b/esphome/components/prometheus/prometheus_handler.cpp index 1b4ae7e68e..9a9ff527e1 100644 --- a/esphome/components/prometheus/prometheus_handler.cpp +++ b/esphome/components/prometheus/prometheus_handler.cpp @@ -840,9 +840,9 @@ void PrometheusHandler::climate_type_(AsyncResponseStream *stream) { stream->print(F("#TYPE esphome_climate_failed gauge\n")); } -void PrometheusHandler::climate_mode_row_(AsyncResponseStream *stream, std::string &category, - std::string &climate_value, std::string &area, std::string &node, - std::string &friendly_name) { +void PrometheusHandler::climate_mode_row_(AsyncResponseStream *stream, climate::Climate *obj, std::string &area, + std::string &node, std::string &friendly_name, std::string &category, + std::string &climate_value) { stream->print(F("esphome_climate_value{id=\"")); stream->print(relabel_id_(obj).c_str()); add_area_label_(stream, area); @@ -884,7 +884,8 @@ void PrometheusHandler::climate_row_(AsyncResponseStream *stream, climate::Clima stream->print(F("\n")); // Now see if position is supported if (obj->get_traits().get_supports_current_temperature()) { - climate_mode_row_(stream, "current_temperature", obj->current_temperature, area, node, friendly_name) + std::string current_temp = "current_temperature"; + climate_mode_row_(stream, obj, area, node, friendly_name, current_temp, obj->current_temperature) } } #endif diff --git a/esphome/components/prometheus/prometheus_handler.h b/esphome/components/prometheus/prometheus_handler.h index e0d0dad6f6..6149b1e7f3 100644 --- a/esphome/components/prometheus/prometheus_handler.h +++ b/esphome/components/prometheus/prometheus_handler.h @@ -175,8 +175,8 @@ class PrometheusHandler : public AsyncWebHandler, public Component { /// Return the climate state as prometheus data point void climate_row_(AsyncResponseStream *stream, climate::Climate *obj, std::string &area, std::string &node, std::string &friendly_name); - void climate_mode_row_(AsyncResponseStream *stream, std::string &category, std::string &climate_value, - std::string &area, std::string &node, std::string &friendly_name); + void climate_mode_row_(AsyncResponseStream *stream, climate::Climate *obj, std::string &area, std::string &node, + std::string &friendly_name, std::string &category, std::string &climate_value); #endif web_server_base::WebServerBase *base_;