8 bool was_active =
false;
9 if (this->
parent_->is_active()) {
11 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
13 this->
parent_->enqueue(make_unique<LedModeCommand>(
state));
14 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
16 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
21 bool was_active =
false;
22 if (this->
parent_->is_active()) {
24 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
26 this->
parent_->enqueue(make_unique<UartOutputCommand>(
state));
27 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
29 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
34 bool was_active =
false;
35 if (this->
parent_->is_active()) {
37 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
39 this->
parent_->enqueue(make_unique<SensorCfgStartCommand>(
state));
40 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
42 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
DfrobotSen0395Component * parent_
void write_state(bool state) override
void write_state(bool state) override
void write_state(bool state) override
void write_state(bool state) override
bool state
The current reported state of the binary sensor.