25#ifdef USE_BINARY_SENSOR
26 if (res.
has_motion.has_value() && this->motion_binary_sensor_ !=
nullptr) {
27 this->motion_binary_sensor_->publish_state(*res.
has_motion);
29 [
this]() { this->motion_binary_sensor_->publish_state(
false); });
32 if (res.
button_press.has_value() && this->button_binary_sensor_ !=
nullptr) {
33 this->button_binary_sensor_->publish_state(*res.
button_press);
35 [
this]() { this->button_binary_sensor_->publish_state(
false); });