From acfa00d769b898f5eed8162e401124f8874c48f3 Mon Sep 17 00:00:00 2001 From: Jordan Zucker Date: Thu, 13 Feb 2025 16:05:55 -0800 Subject: [PATCH] Satisfying clang --- esphome/components/prometheus/prometheus_handler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/prometheus/prometheus_handler.cpp b/esphome/components/prometheus/prometheus_handler.cpp index 0efbca061f..1a6124c49d 100644 --- a/esphome/components/prometheus/prometheus_handler.cpp +++ b/esphome/components/prometheus/prometheus_handler.cpp @@ -887,7 +887,7 @@ void PrometheusHandler::climate_row_(AsyncResponseStream *stream, climate::Clima stream->print(F("\"} 0\n")); // Data itself std::string climate_mode_category = "mode"; - auto climate_mode_value = climate::climate_mode_to_string(obj->mode); + const auto *climate_mode_value = climate::climate_mode_to_string(obj->mode); climate_setting_row_(stream, obj, area, node, friendly_name, climate_mode_category, climate_mode_value); const auto traits = obj->get_traits(); // Now see if traits is supported @@ -931,22 +931,22 @@ void PrometheusHandler::climate_row_(AsyncResponseStream *stream, climate::Clima } if (traits.get_supports_action()) { std::string climate_trait_category = "action"; - auto climate_trait_value = climate::climate_action_to_string(obj->action); + const auto *climate_trait_value = climate::climate_action_to_string(obj->action); climate_setting_row_(stream, obj, area, node, friendly_name, climate_trait_category, climate_trait_value); } if (traits.get_supports_fan_modes() && obj->fan_mode.has_value()) { std::string climate_trait_category = "fan_mode"; - auto climate_trait_value = climate::climate_fan_mode_to_string(obj->fan_mode.value()); + const auto *climate_trait_value = climate::climate_fan_mode_to_string(obj->fan_mode.value()); climate_setting_row_(stream, obj, area, node, friendly_name, climate_trait_category, climate_trait_value); } if (traits.get_supports_presets() && obj->preset.has_value()) { std::string climate_trait_category = "preset"; - auto climate_trait_value = climate::climate_preset_to_string(obj->preset.value()); + const auto *climate_trait_value = climate::climate_preset_to_string(obj->preset.value()); climate_setting_row_(stream, obj, area, node, friendly_name, climate_trait_category, climate_trait_value); } if (traits.get_supports_swing_modes()) { std::string climate_trait_category = "swing_mode"; - auto climate_trait_value = climate::climate_swing_mode_to_string(obj->swing_mode); + const auto *climate_trait_value = climate::climate_swing_mode_to_string(obj->swing_mode); climate_setting_row_(stream, obj, area, node, friendly_name, climate_trait_category, climate_trait_value); } }