mirror of
https://github.com/esphome/esphome.git
synced 2026-05-25 02:16:13 +08:00
[xiaomi_rtcgq02lm] Drop unused capture from timeout lambdas (#14959)
This commit is contained in:
@@ -58,15 +58,13 @@ bool XiaomiRTCGQ02LM::parse_device(const esp32_ble_tracker::ESPBTDevice &device)
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
if (res->has_motion.has_value() && this->motion_ != nullptr) {
|
||||
this->motion_->publish_state(*res->has_motion);
|
||||
this->set_timeout("motion_timeout", this->motion_timeout_,
|
||||
[this, res]() { this->motion_->publish_state(false); });
|
||||
this->set_timeout("motion_timeout", this->motion_timeout_, [this]() { this->motion_->publish_state(false); });
|
||||
}
|
||||
if (res->is_light.has_value() && this->light_ != nullptr)
|
||||
this->light_->publish_state(*res->is_light);
|
||||
if (res->button_press.has_value() && this->button_ != nullptr) {
|
||||
this->button_->publish_state(*res->button_press);
|
||||
this->set_timeout("button_timeout", this->button_timeout_,
|
||||
[this, res]() { this->button_->publish_state(false); });
|
||||
this->set_timeout("button_timeout", this->button_timeout_, [this]() { this->button_->publish_state(false); });
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_SENSOR
|
||||
|
||||
Reference in New Issue
Block a user