From 3b90a8f210ff663bb689375e35a93e39a74a327f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Jan 2026 17:46:04 -1000 Subject: [PATCH] .c_str() --- esphome/components/mqtt/mqtt_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/mqtt/mqtt_client.cpp b/esphome/components/mqtt/mqtt_client.cpp index d68ce33361..7d4050284f 100644 --- a/esphome/components/mqtt/mqtt_client.cpp +++ b/esphome/components/mqtt/mqtt_client.cpp @@ -636,7 +636,7 @@ const MQTTDiscoveryInfo &MQTTClientComponent::get_discovery_info() const { retur void MQTTClientComponent::set_topic_prefix(const std::string &topic_prefix, const std::string &check_topic_prefix) { if (App.is_name_add_mac_suffix_enabled() && (topic_prefix == check_topic_prefix)) { char buf[ESPHOME_DEVICE_NAME_MAX_LEN + 1]; - this->topic_prefix_ = str_sanitize_to(buf, App.get_name()); + this->topic_prefix_ = str_sanitize_to(buf, App.get_name().c_str()); } else { this->topic_prefix_ = topic_prefix; }