ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
lc709203f.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::lc709203f {
8
15
21
23 public:
24 void setup() override;
25 void update() override;
26 void dump_config() override;
27
28 void set_pack_size(uint16_t pack_size);
29 void set_thermistor_b_constant(uint16_t b_constant);
31 void set_voltage_sensor(sensor::Sensor *voltage_sensor) { voltage_sensor_ = voltage_sensor; }
32 void set_battery_remaining_sensor(sensor::Sensor *battery_remaining_sensor) {
33 battery_remaining_sensor_ = battery_remaining_sensor;
34 }
35 void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
36
37 private:
38 uint8_t get_register_(uint8_t register_to_read, uint16_t *register_value);
39 uint8_t set_register_(uint8_t register_to_set, uint16_t value_to_set);
40
41 protected:
45 uint16_t pack_size_;
46 uint16_t apa_;
47 uint16_t b_constant_;
49 uint16_t pack_voltage_;
50};
51
52} // namespace esphome::lc709203f
This class simplifies creating components that periodically check a state.
Definition component.h:602
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
sensor::Sensor * voltage_sensor_
Definition lc709203f.h:42
void set_pack_voltage(LC709203FBatteryVoltage pack_voltage)
void set_thermistor_b_constant(uint16_t b_constant)
sensor::Sensor * battery_remaining_sensor_
Definition lc709203f.h:43
void set_battery_remaining_sensor(sensor::Sensor *battery_remaining_sensor)
Definition lc709203f.h:32
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition lc709203f.h:35
void set_pack_size(uint16_t pack_size)
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
Definition lc709203f.h:31
sensor::Sensor * temperature_sensor_
Definition lc709203f.h:44
Base-class for all sensors.
Definition sensor.h:47
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