mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 10:12:21 +01:00
String manipulation filters for text sensors (#2393)
* initial text sensor filter POC * fixed verbose logging * add append, prepend, substitute filters * add to lower, get to upper working without dummy * clang lint * more linting... * std::move append and prepend filters * fix verbose filter::input logging * value.c_str() in input print * lambda filter verbose log fix * correct log tag, neaten to upper and to lower * add on_raw_value automation/trigger
This commit is contained in:
@@ -16,6 +16,13 @@ class TextSensorStateTrigger : public Trigger<std::string> {
|
||||
}
|
||||
};
|
||||
|
||||
class TextSensorStateRawTrigger : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextSensorStateRawTrigger(TextSensor *parent) {
|
||||
parent->add_on_raw_state_callback([this](std::string value) { this->trigger(std::move(value)); });
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSensorStateCondition : public Condition<Ts...> {
|
||||
public:
|
||||
explicit TextSensorStateCondition(TextSensor *parent) : parent_(parent) {}
|
||||
|
Reference in New Issue
Block a user