mirror of
https://github.com/esphome/esphome.git
synced 2026-01-10 04:00:51 -07:00
[pylontech] Eliminate heap allocations in text sensors (#13033)
This commit is contained in:
@@ -25,16 +25,16 @@ void PylontechTextSensor::on_line_read(PylontechListener::LineContents *line) {
|
||||
return;
|
||||
}
|
||||
if (this->base_state_text_sensor_ != nullptr) {
|
||||
this->base_state_text_sensor_->publish_state(std::string(line->base_st));
|
||||
this->base_state_text_sensor_->publish_state(line->base_st);
|
||||
}
|
||||
if (this->voltage_state_text_sensor_ != nullptr) {
|
||||
this->voltage_state_text_sensor_->publish_state(std::string(line->volt_st));
|
||||
this->voltage_state_text_sensor_->publish_state(line->volt_st);
|
||||
}
|
||||
if (this->current_state_text_sensor_ != nullptr) {
|
||||
this->current_state_text_sensor_->publish_state(std::string(line->curr_st));
|
||||
this->current_state_text_sensor_->publish_state(line->curr_st);
|
||||
}
|
||||
if (this->temperature_state_text_sensor_ != nullptr) {
|
||||
this->temperature_state_text_sensor_->publish_state(std::string(line->temp_st));
|
||||
this->temperature_state_text_sensor_->publish_state(line->temp_st);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user