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