7static const char *
const TAG =
"pylontech.sensor";
16 LOG_SENSOR(
" ",
"Voltage", this->voltage_sensor_);
17 LOG_SENSOR(
" ",
"Current", this->current_sensor_);
18 LOG_SENSOR(
" ",
"Temperature", this->temperature_sensor_);
19 LOG_SENSOR(
" ",
"Temperature low", this->temperature_low_sensor_);
20 LOG_SENSOR(
" ",
"Temperature high", this->temperature_high_sensor_);
21 LOG_SENSOR(
" ",
"Voltage low", this->voltage_low_sensor_);
22 LOG_SENSOR(
" ",
"Voltage high", this->voltage_high_sensor_);
23 LOG_SENSOR(
" ",
"Coulomb", this->coulomb_sensor_);
24 LOG_SENSOR(
" ",
"MOS Temperature", this->mos_temperature_sensor_);
31 if (this->voltage_sensor_ !=
nullptr) {
32 this->voltage_sensor_->publish_state(((
float)
line->volt) / 1000.0f);
34 if (this->current_sensor_ !=
nullptr) {
35 this->current_sensor_->publish_state(((
float)
line->curr) / 1000.0f);
37 if (this->temperature_sensor_ !=
nullptr) {
38 this->temperature_sensor_->publish_state(((
float)
line->tempr) / 1000.0f);
40 if (this->temperature_low_sensor_ !=
nullptr) {
41 this->temperature_low_sensor_->publish_state(((
float)
line->tlow) / 1000.0f);
43 if (this->temperature_high_sensor_ !=
nullptr) {
44 this->temperature_high_sensor_->publish_state(((
float)
line->thigh) / 1000.0f);
46 if (this->voltage_low_sensor_ !=
nullptr) {
47 this->voltage_low_sensor_->publish_state(((
float)
line->vlow) / 1000.0f);
49 if (this->voltage_high_sensor_ !=
nullptr) {
50 this->voltage_high_sensor_->publish_state(((
float)
line->vhigh) / 1000.0f);
52 if (this->coulomb_sensor_ !=
nullptr) {
53 this->coulomb_sensor_->publish_state(
line->coulomb);
55 if (this->mos_temperature_sensor_ !=
nullptr) {
56 this->mos_temperature_sensor_->publish_state(((
float)
line->mostempr) / 1000.0f);
virtual void on_line_read(LineContents *line)
void dump_config() override
PylontechSensor(int8_t bat_num)