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:
committed by
GitHub
parent
582567696e
commit
aae63a7ff3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user