ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
lc709203f.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::lc709203f {
8
15
21
22class Lc709203f final : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
23 SUB_SENSOR(voltage)
24 SUB_SENSOR(battery_remaining)
25 SUB_SENSOR(temperature)
26
27 public:
28 void setup() override;
29 void update() override;
30 void dump_config() override;
31
32 void set_pack_size(uint16_t pack_size);
33 void set_thermistor_b_constant(uint16_t b_constant) { this->b_constant_ = b_constant; }
34 void set_pack_voltage(LC709203FBatteryVoltage pack_voltage) { this->pack_voltage_ = pack_voltage; }
35
36 private:
37 uint8_t get_register_(uint8_t register_to_read, uint16_t *register_value);
38 uint8_t set_register_(uint8_t register_to_set, uint16_t value_to_set);
39
40 protected:
41 uint16_t pack_size_;
42 uint16_t apa_;
43 uint16_t b_constant_;
45 uint16_t pack_voltage_;
46};
47
48} // namespace esphome::lc709203f
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
This class simplifies creating components that periodically check a state.
Definition component.h:532
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
Base-class for all sensors.
Definition sensor.h:48
LC709203FBatteryVoltage
Enum listing allowable voltage settings for the LC709203F.
Definition lc709203f.h:17
@ LC709203F_BATTERY_VOLTAGE_3_7
Definition lc709203f.h:19
@ LC709203F_BATTERY_VOLTAGE_3_8
Definition lc709203f.h:18
uint16_t temperature
Definition sun_gtil2.cpp:12