mirror of
https://github.com/esphome/esphome.git
synced 2026-05-28 13:15:46 +08:00
.c_str()
This commit is contained in:
@@ -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) {
|
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)) {
|
if (App.is_name_add_mac_suffix_enabled() && (topic_prefix == check_topic_prefix)) {
|
||||||
char buf[ESPHOME_DEVICE_NAME_MAX_LEN + 1];
|
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 {
|
} else {
|
||||||
this->topic_prefix_ = topic_prefix;
|
this->topic_prefix_ = topic_prefix;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user