ESPHome  2024.11.1
pylontech_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../pylontech.h"
5 
6 namespace esphome {
7 namespace pylontech {
8 
9 class PylontechSensor : public PylontechListener, public Component {
10  public:
11  PylontechSensor(int8_t bat_num);
12  void dump_config() override;
13 
14  SUB_SENSOR(voltage)
15  SUB_SENSOR(current)
17  SUB_SENSOR(temperature_low)
18  SUB_SENSOR(temperature_high)
19  SUB_SENSOR(voltage_low)
20  SUB_SENSOR(voltage_high)
21 
22  SUB_SENSOR(coulomb)
23  SUB_SENSOR(mos_temperature)
24 
25  void on_line_read(LineContents *line) override;
26 
27  protected:
28  int8_t bat_num_;
29 };
30 
31 } // namespace pylontech
32 } // namespace esphome
uint16_t temperature
Definition: sun_gtil2.cpp:26
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
virtual void on_line_read(LineContents *line)
SUB_SENSOR(voltage) SUB_SENSOR(current) SUB_SENSOR(temperature) SUB_SENSOR(temperature_low) SUB_SENSOR(temperature_high) SUB_SENSOR(voltage_low) SUB_SENSOR(voltage_high) SUB_SENSOR(coulomb) SUB_SENSOR(mos_temperature) void on_line_read(LineContents *line) override