1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 02:02:21 +01:00
This commit is contained in:
Otto Winter
2019-04-24 23:49:02 +02:00
parent 0a0713f0e2
commit 766f6c045d
44 changed files with 1202 additions and 592 deletions

View File

@@ -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) {}