mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 02:02:21 +01:00
Updates
This commit is contained in:
@@ -14,6 +14,18 @@ class TextSensorStateTrigger : public Trigger<std::string> {
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSensorStateCondition : public Condition<Ts...> {
|
||||
public:
|
||||
explicit TextSensorStateCondition(TextSensor *parent) : parent_(parent) {}
|
||||
|
||||
TEMPLATABLE_VALUE(std::string, state)
|
||||
|
||||
bool check(Ts... x) override { return this->parent_->state == this->state_.value(x...); }
|
||||
|
||||
protected:
|
||||
TextSensor *parent_;
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSensorPublishAction : public Action<Ts...> {
|
||||
public:
|
||||
TextSensorPublishAction(TextSensor *sensor) : sensor_(sensor) {}
|
||||
|
Reference in New Issue
Block a user