1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

Add climate on_state trigger (#2707)

This commit is contained in:
Sergey V. DUDANOV
2021-11-13 18:42:15 +04:00
committed by GitHub
parent 582567696e
commit aae63a7ff3
3 changed files with 21 additions and 0 deletions

View File

@@ -42,5 +42,12 @@ template<typename... Ts> class ControlAction : public Action<Ts...> {
Climate *climate_;
};
class StateTrigger : public Trigger<> {
public:
StateTrigger(Climate *climate) {
climate->add_on_state_callback([this]() { this->trigger(); });
}
};
} // namespace climate
} // namespace esphome