mirror of
https://github.com/esphome/esphome.git
synced 2026-10-02 01:10:22 +00:00
[text_sensor] Guard raw_callback_ behind USE_TEXT_SENSOR_FILTER, save 4 bytes per instance (#15097)
This commit is contained in:
@@ -31,7 +31,9 @@ void TextSensor::publish_state(const char *state, size_t len) {
|
||||
if (len != this->state.size() || memcmp(state, this->state.data(), len) != 0) {
|
||||
this->state.assign(state, len);
|
||||
}
|
||||
#ifdef USE_TEXT_SENSOR_FILTER
|
||||
this->raw_callback_.call(this->state);
|
||||
#endif
|
||||
ESP_LOGV(TAG, "'%s': Received new state %s", this->name_.c_str(), this->state.c_str());
|
||||
this->notify_frontend_();
|
||||
#ifdef USE_TEXT_SENSOR_FILTER
|
||||
|
||||
Reference in New Issue
Block a user