ESPHome  2021.10.2
ina219.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace ina219 {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  float get_setup_priority() const override;
15  void update() override;
16 
17  void set_shunt_resistance_ohm(float shunt_resistance_ohm) { shunt_resistance_ohm_ = shunt_resistance_ohm; }
18  void set_max_current_a(float max_current_a) { max_current_a_ = max_current_a; }
19  void set_max_voltage_v(float max_voltage_v) { max_voltage_v_ = max_voltage_v; }
20  void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor) { bus_voltage_sensor_ = bus_voltage_sensor; }
21  void set_shunt_voltage_sensor(sensor::Sensor *shunt_voltage_sensor) { shunt_voltage_sensor_ = shunt_voltage_sensor; }
22  void set_current_sensor(sensor::Sensor *current_sensor) { current_sensor_ = current_sensor; }
23  void set_power_sensor(sensor::Sensor *power_sensor) { power_sensor_ = power_sensor; }
24 
25  protected:
29  uint32_t calibration_lsb_;
34 };
35 
36 } // namespace ina219
37 } // namespace esphome
void set_max_current_a(float max_current_a)
Definition: ina219.h:18
This class simplifies creating components that periodically check a state.
Definition: component.h:234
void set_shunt_resistance_ohm(float shunt_resistance_ohm)
Definition: ina219.h:17
void set_max_voltage_v(float max_voltage_v)
Definition: ina219.h:19
sensor::Sensor * current_sensor_
Definition: ina219.h:32
float get_setup_priority() const override
Definition: ina219.cpp:148
void set_current_sensor(sensor::Sensor *current_sensor)
Definition: ina219.h:22
sensor::Sensor * bus_voltage_sensor_
Definition: ina219.h:30
sensor::Sensor * power_sensor_
Definition: ina219.h:33
void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor)
Definition: ina219.h:20
void set_power_sensor(sensor::Sensor *power_sensor)
Definition: ina219.h:23
Library based on https://github.com/miguelbalboa/rfid and adapted to ESPHome by . ...
Definition: a4988.cpp:4
void set_shunt_voltage_sensor(sensor::Sensor *shunt_voltage_sensor)
Definition: ina219.h:21
Base-class for all sensors.
Definition: sensor.h:47
sensor::Sensor * shunt_voltage_sensor_
Definition: ina219.h:31