8 static const char *
const TAG =
"pylontech.textsensor";
13 ESP_LOGCONFIG(TAG,
"Pylontech Text Sensor:");
14 ESP_LOGCONFIG(TAG,
" Battery %d", this->
bat_num_);
15 LOG_TEXT_SENSOR(
" ",
"Base state", this->base_state_text_sensor_);
16 LOG_TEXT_SENSOR(
" ",
"Voltage state", this->voltage_state_text_sensor_);
17 LOG_TEXT_SENSOR(
" ",
"Current state", this->current_state_text_sensor_);
18 LOG_TEXT_SENSOR(
" ",
"Temperature state", this->temperature_state_text_sensor_);
25 if (this->base_state_text_sensor_ !=
nullptr) {
26 this->base_state_text_sensor_->publish_state(std::string(line->
base_st));
28 if (this->voltage_state_text_sensor_ !=
nullptr) {
29 this->voltage_state_text_sensor_->publish_state(std::string(line->
volt_st));
31 if (this->current_state_text_sensor_ !=
nullptr) {
32 this->current_state_text_sensor_->publish_state(std::string(line->
curr_st));
34 if (this->temperature_state_text_sensor_ !=
nullptr) {
35 this->temperature_state_text_sensor_->publish_state(std::string(line->
temp_st));
char temp_st[TEXT_SENSOR_MAX_LEN]
char curr_st[TEXT_SENSOR_MAX_LEN]
char volt_st[TEXT_SENSOR_MAX_LEN]
PylontechTextSensor(int8_t bat_num)
char base_st[TEXT_SENSOR_MAX_LEN]
Implementation of SPI Controller mode.
void dump_config() override
virtual void on_line_read(LineContents *line)