[sensor] Remove USE_SENSOR_FILTER guard from SensorRawStateTrigger

add_on_raw_state_callback is always available now (delegates to
callback_ without filters). SensorRawStateTrigger doesn't need
the guard, and on_raw_value doesn't need to set USE_SENSOR_FILTER.

Without filters raw == filtered, so the trigger fires with the
correct value either way — no wasted RAM on filter infrastructure.
This commit is contained in:
J. Nick Koston
2026-03-22 16:51:01 -10:00
parent 30b5c3fb71
commit 9578376f46
2 changed files with 0 additions and 3 deletions
-1
View File
@@ -901,7 +901,6 @@ async def _build_sensor_automations(var, config):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(float, "x")], conf)
for conf in config.get(CONF_ON_RAW_VALUE, []):
cg.add_define("USE_SENSOR_FILTER")
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(float, "x")], conf)
for conf in config.get(CONF_ON_VALUE_RANGE, []):
-2
View File
@@ -13,14 +13,12 @@ class SensorStateTrigger : public Trigger<float> {
}
};
#ifdef USE_SENSOR_FILTER
class SensorRawStateTrigger : public Trigger<float> {
public:
explicit SensorRawStateTrigger(Sensor *parent) {
parent->add_on_raw_state_callback([this](float value) { this->trigger(value); });
}
};
#endif
template<typename... Ts> class SensorPublishAction : public Action<Ts...> {
public: