ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
pylontech_text_sensor.cpp
Go to the documentation of this file.
3#include "esphome/core/log.h"
4
5namespace esphome::pylontech {
6
7ESPHOME_LOG_TAG(TAG, "pylontech.textsensor");
8
10 ESP_LOGCONFIG(TAG,
11 "Pylontech Text Sensor:\n"
12 " Battery %u",
13 this->bat_num_);
14 LOG_TEXT_SENSOR(" ", "Base state", this->base_state_text_sensor_);
15 LOG_TEXT_SENSOR(" ", "Voltage state", this->voltage_state_text_sensor_);
16 LOG_TEXT_SENSOR(" ", "Current state", this->current_state_text_sensor_);
17 LOG_TEXT_SENSOR(" ", "Temperature state", this->temperature_state_text_sensor_);
18}
19
21 PUBLISH_STATE(this->base_state_text_sensor_, line->base_st);
22 PUBLISH_STATE(this->voltage_state_text_sensor_, line->volt_st);
23 PUBLISH_STATE(this->current_state_text_sensor_, line->curr_st);
24 PUBLISH_STATE(this->temperature_state_text_sensor_, line->temp_st);
25}
26
27} // namespace esphome::pylontech
virtual void on_line_read(LineContents *line)=0
Called only with records for this listener's battery.
ESPHOME_LOG_TAG(TAG, "pylontech")