ESPHome
2025.2.0
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
+
Functions
_
a
l
m
o
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
Typedefs
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
esphome
esphome
components
micronova
text_sensor
micronova_text_sensor.cpp
Go to the documentation of this file.
1
#include "
micronova_text_sensor.h
"
2
3
namespace
esphome
{
4
namespace
micronova {
5
6
void
MicroNovaTextSensor::process_value_from_stove
(
int
value_from_stove) {
7
if
(value_from_stove == -1) {
8
this->
publish_state
(
"unknown"
);
9
return
;
10
}
11
12
switch
(this->
get_function
()) {
13
case
MicroNovaFunctions::STOVE_FUNCTION_STOVE_STATE
:
14
this->
micronova_
->
set_current_stove_state
(value_from_stove);
15
this->
publish_state
(STOVE_STATES[value_from_stove]);
16
// set the stove switch to on for any value but 0
17
if
(value_from_stove != 0 && this->
micronova_
->
get_stove_switch
() !=
nullptr
&&
18
!this->
micronova_
->
get_stove_switch
()->
get_stove_state
()) {
19
this->
micronova_
->
get_stove_switch
()->
set_stove_state
(
true
);
20
}
else
if
(value_from_stove == 0 && this->
micronova_
->
get_stove_switch
() !=
nullptr
&&
21
this->
micronova_
->
get_stove_switch
()->
get_stove_state
()) {
22
this->
micronova_
->
get_stove_switch
()->
set_stove_state
(
false
);
23
}
24
break
;
25
default
:
26
break
;
27
}
28
}
29
30
}
// namespace micronova
31
}
// namespace esphome
esphome::micronova::MicroNovaBaseListener::get_function
MicroNovaFunctions get_function()
Definition:
micronova.h:58
esphome::micronova::MicroNova::get_stove_switch
MicroNovaSwitchListener * get_stove_switch()
Definition:
micronova.h:141
esphome::text_sensor::TextSensor::publish_state
void publish_state(const std::string &state)
Definition:
text_sensor.cpp:9
esphome::micronova::MicroNovaTextSensor::process_value_from_stove
void process_value_from_stove(int value_from_stove) override
Definition:
micronova_text_sensor.cpp:6
micronova_text_sensor.h
esphome::micronova::MicroNova::set_current_stove_state
void set_current_stove_state(uint8_t s)
Definition:
micronova.h:137
esphome::micronova::MicroNovaSwitchListener::get_stove_state
virtual bool get_stove_state()=0
esphome::micronova::MicroNovaSwitchListener::set_stove_state
virtual void set_stove_state(bool v)=0
esphome::micronova::MicroNovaBaseListener::micronova_
MicroNova * micronova_
Definition:
micronova.h:67
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::micronova::MicroNovaFunctions::STOVE_FUNCTION_STOVE_STATE
Generated by
1.8.13