ESPHome 2026.11.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
4namespace esphome::systa_bus {
5
6ESPHOME_LOG_TAG(TAG, "systa_bus.text_sensor");
7
9 ESP_LOGCONFIG(TAG, "SystaSolar Aqua:");
10 LOG_TEXT_SENSOR(" ", "Error code", this->error_code_text_sensor_);
11}
12
13void 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) {
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
void handle_message(std::span< const uint8_t > message) override
void publish_state(const std::string &state)
Definition text_sensor.h:41
const LogString * message
Definition component.cpp:35
uint16_t get_message_type(std::span< const uint8_t > message)
Definition systa_bus.h:24
ESPHOME_LOG_TAG(TAG, "systa_bus.sensor")
const void size_t len
Definition hal.h:68