ESPHome
2026.12.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
#include <cstdio>
5
6
namespace
esphome::systa_bus
{
7
8
void
publish_aqua_error_code
(
text_sensor::TextSensor
*sensor, std::span<const uint8_t>
message
) {
9
if
(
message
[15] == 0) {
10
sensor->
publish_state
(
"--"
);
11
return
;
12
}
13
char
buf[4];
14
int
len
= snprintf(buf,
sizeof
(buf),
"%02d"
,
message
[15]);
15
sensor->
publish_state
(buf,
static_cast<
size_t
>
(
len
));
16
}
17
18
void
dump_aqua_error_code
(
const
char
*log_tag,
text_sensor::TextSensor
*sensor) {
19
text_sensor::log_text_sensor
(log_tag,
" "
, LOG_STR_LITERAL(
"Error code"
), sensor);
20
}
21
22
}
// namespace esphome::systa_bus
esphome::text_sensor::TextSensor
Definition
text_sensor.h:29
esphome::text_sensor::TextSensor::publish_state
void publish_state(const std::string &state)
Definition
text_sensor.h:42
message
const LogString * message
Definition
component.cpp:35
log.h
esphome::systa_bus
Definition
systa_bus_sensor.cpp:5
esphome::systa_bus::dump_aqua_error_code
void dump_aqua_error_code(const char *log_tag, text_sensor::TextSensor *sensor)
Definition
systa_bus_text_sensor.cpp:18
esphome::systa_bus::publish_aqua_error_code
void publish_aqua_error_code(text_sensor::TextSensor *sensor, std::span< const uint8_t > message)
Definition
systa_bus_text_sensor.cpp:8
esphome::text_sensor::log_text_sensor
void log_text_sensor(const char *tag, const char *prefix, const char *type, TextSensor *obj)
Definition
text_sensor.cpp:11
esphome::len
const void size_t len
Definition
hal.h:68
systa_bus_text_sensor.h
Generated by
1.12.0