ESPHome
2025.3.3
Main Page
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
d
e
f
i
j
l
m
n
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
d
o
p
s
t
v
w
+
Enumerations
b
c
e
f
i
m
n
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
l
m
o
p
s
t
u
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
esphome
esphome
components
pipsolar
switch
pipsolar_switch.cpp
Go to the documentation of this file.
1
#include "
pipsolar_switch.h
"
2
#include "
esphome/core/log.h
"
3
#include "
esphome/core/application.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
); }
11
void
PipsolarSwitch::write_state
(
bool
state
) {
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
pipsolar_switch.h
application.h
esphome::pipsolar::PipsolarSwitch::on_command_
std::string on_command_
Definition:
pipsolar_switch.h:19
esphome::pipsolar::PipsolarSwitch::dump_config
void dump_config() override
Definition:
pipsolar_switch.cpp:10
esphome::pipsolar::PipsolarSwitch::off_command_
std::string off_command_
Definition:
pipsolar_switch.h:20
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::pipsolar::PipsolarSwitch::write_state
void write_state(bool state) override
Definition:
pipsolar_switch.cpp:11
log.h
esphome::switch_::Switch::state
bool state
The current reported state of the binary sensor.
Definition:
switch.h:53
esphome::pipsolar::PipsolarSwitch::parent_
Pipsolar * parent_
Definition:
pipsolar_switch.h:21
Generated by
1.8.13