mirror of
https://github.com/esphome/esphome.git
synced 2026-03-23 22:37:31 +08:00
[binary_sensor] Replace std::bind with inline lambda in MultiClickTrigger (#14956)
This commit is contained in:
@@ -96,8 +96,7 @@ class MultiClickTrigger : public Trigger<>, public Component {
|
||||
|
||||
void setup() override {
|
||||
this->last_state_ = this->parent_->get_state_default(false);
|
||||
auto f = std::bind(&MultiClickTrigger::on_state_, this, std::placeholders::_1);
|
||||
this->parent_->add_on_state_callback(f);
|
||||
this->parent_->add_on_state_callback([this](bool state) { this->on_state_(state); });
|
||||
}
|
||||
|
||||
float get_setup_priority() const override { return setup_priority::HARDWARE; }
|
||||
|
||||
Reference in New Issue
Block a user