ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
systa_bus_text_sensor.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
3
4#include <cstdio>
5
6namespace esphome::systa_bus {
7
8void 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
18void 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
void publish_state(const std::string &state)
Definition text_sensor.h:42
const LogString * message
Definition component.cpp:35
void dump_aqua_error_code(const char *log_tag, text_sensor::TextSensor *sensor)
void publish_aqua_error_code(text_sensor::TextSensor *sensor, std::span< const uint8_t > message)
void log_text_sensor(const char *tag, const char *prefix, const char *type, TextSensor *obj)
const void size_t len
Definition hal.h:68