4 namespace dfrobot_sen0395 {
9 bool was_active =
false;
10 if (this->
parent_->is_active()) {
12 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
14 this->
parent_->enqueue(make_unique<LedModeCommand>(state));
15 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
17 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
22 bool was_active =
false;
23 if (this->
parent_->is_active()) {
25 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
27 this->
parent_->enqueue(make_unique<UartOutputCommand>(state));
28 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
30 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
35 bool was_active =
false;
36 if (this->
parent_->is_active()) {
38 this->
parent_->enqueue(make_unique<PowerCommand>(
false));
40 this->
parent_->enqueue(make_unique<SensorCfgStartCommand>(state));
41 this->
parent_->enqueue(make_unique<SaveCfgCommand>());
43 this->
parent_->enqueue(make_unique<PowerCommand>(
true));
void write_state(bool state) override
void write_state(bool state) override
DfrobotSen0395Component * parent_
void write_state(bool state) override
void write_state(bool state) override
Implementation of SPI Controller mode.
bool state
The current reported state of the binary sensor.