29 void play(const Ts &...
x) {
30 this->
parent_->enqueue(make_unique<PowerCommand>(0));
31 if (this->factory_reset_.has_value() && this->factory_reset_.value(
x...) ==
true) {
32 this->parent_->enqueue(make_unique<FactoryResetCommand>());
34 if (this->det_min1_.has_value() && this->det_max1_.has_value()) {
35 if (this->det_min1_.value() >= 0 && this->det_max1_.value() >= 0) {
36 this->parent_->enqueue(make_unique<DetRangeCfgCommand>(
37 this->det_min1_.value_or(-1), this->det_max1_.value_or(-1), this->det_min2_.value_or(-1),
38 this->det_max2_.value_or(-1), this->det_min3_.value_or(-1), this->det_max3_.value_or(-1),
39 this->det_min4_.value_or(-1), this->det_max4_.value_or(-1)));
42 if (this->delay_after_detect_.has_value() && this->delay_after_disappear_.has_value()) {
43 float detect = this->delay_after_detect_.value(x...);
44 float disappear = this->delay_after_disappear_.value(x...);
45 if (detect >= 0 && disappear >= 0) {
46 this->parent_->enqueue(make_unique<SetLatencyCommand>(detect, disappear));
49 if (this->start_after_power_on_.has_value()) {
50 int8_t val = this->start_after_power_on_.value(x...);
52 this->parent_->enqueue(make_unique<SensorCfgStartCommand>(val));
55 if (this->turn_on_led_.has_value()) {
56 int8_t val = this->turn_on_led_.value(x...);
58 this->parent_->enqueue(make_unique<LedModeCommand>(val));
61 if (this->presence_via_uart_.has_value()) {
62 int8_t val = this->presence_via_uart_.value(x...);
64 this->parent_->enqueue(make_unique<UartOutputCommand>(val));
67 if (this->sensitivity_.has_value()) {
68 int8_t val = this->sensitivity_.value(x...);
73 this->parent_->enqueue(make_unique<SensitivityCommand>(val));
76 this->parent_->enqueue(make_unique<SaveCfgCommand>());
77 this->parent_->enqueue(make_unique<PowerCommand>(1));