31 void play(const Ts &...
x)
override {
33 if (!this->
parent_->has_queue_room(10))
36 if (this->factory_reset_.has_value() && this->factory_reset_.value(
x...) ==
true) {
37 this->parent_->enqueue(CommandType::COMMAND_TYPE_FACTORY_RESET);
39 if (this->det_min1_.has_value() && this->det_max1_.has_value()) {
41 const float min1 = this->det_min1_.value(x...);
43 const float max1 = this->det_max1_.value(x...);
45 this->parent_->enqueue_det_range_cfg(min1, max1, this->det_min2_.value_or(x..., -1),
46 this->det_max2_.value_or(x..., -1), this->det_min3_.value_or(x..., -1),
47 this->det_max3_.value_or(x..., -1), this->det_min4_.value_or(x..., -1),
48 this->det_max4_.value_or(x..., -1));
52 if (this->delay_after_detect_.has_value() && this->delay_after_disappear_.has_value()) {
53 float detect = this->delay_after_detect_.value(x...);
54 float disappear = this->delay_after_disappear_.value(x...);
55 if (detect >= 0 && disappear >= 0) {
56 this->parent_->enqueue_set_latency(detect, disappear);
59 if (this->start_after_power_on_.has_value()) {
60 int8_t val = this->start_after_power_on_.value(x...);
62 this->parent_->enqueue(CommandType::COMMAND_TYPE_SENSOR_CFG_START, val);
65 if (this->turn_on_led_.has_value()) {
66 int8_t val = this->turn_on_led_.value(x...);
68 this->parent_->enqueue(CommandType::COMMAND_TYPE_LED_MODE, val);
71 if (this->presence_via_uart_.has_value()) {
72 int8_t val = this->presence_via_uart_.value(x...);
74 this->parent_->enqueue(CommandType::COMMAND_TYPE_UART_OUTPUT, val);
77 if (this->sensitivity_.has_value()) {
78 int8_t val = this->sensitivity_.value(x...);
80 this->parent_->enqueue(CommandType::COMMAND_TYPE_SENSITIVITY, std::min<int8_t>(val, 9));
83 this->parent_->enqueue(CommandType::COMMAND_TYPE_SAVE_CFG);
84 this->parent_->enqueue(CommandType::COMMAND_TYPE_POWER,
true);