1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 12:22:20 +01:00

Reduce memory usage with StringRef in MQTT Components (#5719)

This commit is contained in:
kahrendt
2023-12-21 02:19:15 -05:00
committed by GitHub
parent 222bb9b495
commit 74281b93c4
3 changed files with 15 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ void MQTTBinarySensorComponent::dump_config() {
MQTTBinarySensorComponent::MQTTBinarySensorComponent(binary_sensor::BinarySensor *binary_sensor)
: binary_sensor_(binary_sensor) {
if (this->binary_sensor_->is_status_binary_sensor()) {
this->set_custom_state_topic(mqtt::global_mqtt_client->get_availability().topic);
this->set_custom_state_topic(mqtt::global_mqtt_client->get_availability().topic.c_str());
}
}