mirror of
https://github.com/esphome/esphome.git
synced 2026-05-28 13:37:24 +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
|
#ifdef USE_BINARY_SENSOR
|
||||||
if (res->has_motion.has_value() && this->motion_ != nullptr) {
|
if (res->has_motion.has_value() && this->motion_ != nullptr) {
|
||||||
this->motion_->publish_state(*res->has_motion);
|
this->motion_->publish_state(*res->has_motion);
|
||||||
this->set_timeout("motion_timeout", this->motion_timeout_,
|
this->set_timeout("motion_timeout", this->motion_timeout_, [this]() { this->motion_->publish_state(false); });
|
||||||
[this, res]() { this->motion_->publish_state(false); });
|
|
||||||
}
|
}
|
||||||
if (res->is_light.has_value() && this->light_ != nullptr)
|
if (res->is_light.has_value() && this->light_ != nullptr)
|
||||||
this->light_->publish_state(*res->is_light);
|
this->light_->publish_state(*res->is_light);
|
||||||
if (res->button_press.has_value() && this->button_ != nullptr) {
|
if (res->button_press.has_value() && this->button_ != nullptr) {
|
||||||
this->button_->publish_state(*res->button_press);
|
this->button_->publish_state(*res->button_press);
|
||||||
this->set_timeout("button_timeout", this->button_timeout_,
|
this->set_timeout("button_timeout", this->button_timeout_, [this]() { this->button_->publish_state(false); });
|
||||||
[this, res]() { this->button_->publish_state(false); });
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_SENSOR
|
#ifdef USE_SENSOR
|
||||||
|
|||||||
Reference in New Issue
Block a user