ESPHome 2025.5.0
Loading...
Searching...
No Matches
pipsolar_switch.cpp
Go to the documentation of this file.
1#include "pipsolar_switch.h"
2#include "esphome/core/log.h"
4
5namespace esphome {
6namespace pipsolar {
7
8static const char *const TAG = "pipsolar.switch";
9
10void PipsolarSwitch::dump_config() { LOG_SWITCH("", "Pipsolar Switch", this); }
12 if (state) {
13 if (!this->on_command_.empty()) {
14 this->parent_->switch_command(this->on_command_);
15 }
16 } else {
17 if (!this->off_command_.empty()) {
18 this->parent_->switch_command(this->off_command_);
19 }
20 }
21}
22
23} // namespace pipsolar
24} // namespace esphome
void write_state(bool state) override
bool state
The current reported state of the binary sensor.
Definition switch.h:53
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7