diff --git a/esphome/components/sensor/__init__.py b/esphome/components/sensor/__init__.py index 44ba87f86a..9f3c1484b0 100644 --- a/esphome/components/sensor/__init__.py +++ b/esphome/components/sensor/__init__.py @@ -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, []): diff --git a/esphome/components/sensor/automation.h b/esphome/components/sensor/automation.h index bcd2ca0f0d..b4de712727 100644 --- a/esphome/components/sensor/automation.h +++ b/esphome/components/sensor/automation.h @@ -13,14 +13,12 @@ class SensorStateTrigger : public Trigger { } }; -#ifdef USE_SENSOR_FILTER class SensorRawStateTrigger : public Trigger { public: explicit SensorRawStateTrigger(Sensor *parent) { parent->add_on_raw_state_callback([this](float value) { this->trigger(value); }); } }; -#endif template class SensorPublishAction : public Action { public: