ESPHome
2026.11.0-dev
Loading...
Searching...
No Matches
esphome
components
systa_bus
text_sensor
systa_bus_text_sensor.cpp
Go to the documentation of this file.
1
#include "
systa_bus_text_sensor.h
"
2
#include "
esphome/core/log.h
"
3
4
namespace
esphome::systa_bus
{
5
6
ESPHOME_LOG_TAG
(TAG,
"systa_bus.text_sensor"
);
7
8
void
SystaSolarAquaTextSensor::dump_config
() {
9
ESP_LOGCONFIG(TAG,
"SystaSolar Aqua:"
);
10
LOG_TEXT_SENSOR(
" "
,
"Error code"
, this->
error_code_text_sensor_
);
11
}
12
13
void
SystaSolarAquaTextSensor::handle_message
(std::span<const uint8_t>
message
) {
14
if
(
get_message_type
(
message
) == MESSAGE_TYPE_AQUA_SENSOR_DATA) {
15
if
(this->
error_code_text_sensor_
!=
nullptr
) {
16
if
(message[15] == 0) {
17
this->
error_code_text_sensor_
->
publish_state
(
"--"
);
18
}
else
{
19
char
buf[4];
20
int
len
= snprintf(buf,
sizeof
(buf),
"%02d"
,
message
[15]);
21
this->
error_code_text_sensor_
->
publish_state
(buf,
static_cast<
size_t
>
(
len
));
22
}
23
}
24
}
25
}
26
27
}
// namespace esphome::systa_bus
esphome::systa_bus::SystaSolarAquaTextSensor::dump_config
void dump_config() override
Definition
systa_bus_text_sensor.cpp:8
esphome::systa_bus::SystaSolarAquaTextSensor::error_code_text_sensor_
text_sensor::TextSensor * error_code_text_sensor_
Definition
systa_bus_text_sensor.h:17
esphome::systa_bus::SystaSolarAquaTextSensor::handle_message
void handle_message(std::span< const uint8_t > message) override
Definition
systa_bus_text_sensor.cpp:13
esphome::text_sensor::TextSensor::publish_state
void publish_state(const std::string &state)
Definition
text_sensor.h:41
message
const LogString * message
Definition
component.cpp:35
log.h
esphome::systa_bus
Definition
systa_bus_sensor.cpp:5
esphome::systa_bus::get_message_type
uint16_t get_message_type(std::span< const uint8_t > message)
Definition
systa_bus.h:24
esphome::systa_bus::ESPHOME_LOG_TAG
ESPHOME_LOG_TAG(TAG, "systa_bus.sensor")
esphome::len
const void size_t len
Definition
hal.h:68
systa_bus_text_sensor.h
Generated by
1.12.0