From 66fa08264c4ec542b09406f0adb3bae6619afca0 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 13 Feb 2025 14:24:55 -0800 Subject: [PATCH] And again --- esphome/components/prometheus/prometheus_handler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/prometheus/prometheus_handler.cpp b/esphome/components/prometheus/prometheus_handler.cpp index 1867f144dc..f3123edea8 100644 --- a/esphome/components/prometheus/prometheus_handler.cpp +++ b/esphome/components/prometheus/prometheus_handler.cpp @@ -882,12 +882,13 @@ void PrometheusHandler::climate_row_(AsyncResponseStream *stream, climate::Clima stream->print(F("\"} ")); stream->print(F("1.0")); stream->print(F("\n")); + const auto traits = obj->get_traits(); // Now see if position is supported - if (obj->get_traits().get_supports_current_temperature()) { + if (traits.get_supports_current_temperature()) { std::string current_temp = "current_temperature"; int8_t current_accuracy = traits.get_current_temperature_accuracy_decimals(); - climate_mode_row_(stream, obj, area, node, friendly_name, current_temp, - value_accuracy_to_string(obj->current_temperature, current_accuracy)) + auto current_temp_value = value_accuracy_to_string(obj->current_temperature, current_accuracy); + climate_mode_row_(stream, obj, area, node, friendly_name, current_temp, current_temp_value); } } #endif