ESPHome  2024.11.1
pipsolar_switch.cpp
Go to the documentation of this file.
1 #include "pipsolar_switch.h"
2 #include "esphome/core/log.h"
4 
5 namespace esphome {
6 namespace pipsolar {
7 
8 static const char *const TAG = "pipsolar.switch";
9 
10 void PipsolarSwitch::dump_config() { LOG_SWITCH("", "Pipsolar Switch", this); }
12  if (state) {
13  if (this->on_command_.length() > 0) {
14  this->parent_->switch_command(this->on_command_);
15  }
16  } else {
17  if (this->off_command_.length() > 0) {
18  this->parent_->switch_command(this->off_command_);
19  }
20  }
21 }
22 
23 } // namespace pipsolar
24 } // namespace esphome
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void write_state(bool state) override
bool state
The current reported state of the binary sensor.
Definition: switch.h:53