mirror of
https://github.com/esphome/esphome.git
synced 2026-09-19 11:08:38 +00:00
[text_sensor] Clarify compile-time vs runtime in raw_callback comment
This commit is contained in:
@@ -64,7 +64,8 @@ class TextSensor : public EntityBase {
|
||||
|
||||
template<typename F> void add_on_state_callback(F &&callback) { this->callback_.add(std::forward<F>(callback)); }
|
||||
/// Add a callback that will be called every time the sensor sends a raw value.
|
||||
/// Without filters, raw state equals filtered state so this delegates to the regular callback.
|
||||
/// When USE_TEXT_SENSOR_FILTER is not enabled, delegates to the regular callback
|
||||
/// since raw state equals filtered state without filter support compiled in.
|
||||
template<typename F> void add_on_raw_state_callback(F &&callback) {
|
||||
#ifdef USE_TEXT_SENSOR_FILTER
|
||||
this->raw_callback_.add(std::forward<F>(callback));
|
||||
|
||||
Reference in New Issue
Block a user