ESPHome  2024.12.2
ina260.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace ina260 {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  void update() override;
15 
16  float get_setup_priority() const override { return setup_priority::DATA; }
17 
18  void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor) { this->bus_voltage_sensor_ = bus_voltage_sensor; }
19  void set_current_sensor(sensor::Sensor *current_sensor) { this->current_sensor_ = current_sensor; }
20  void set_power_sensor(sensor::Sensor *power_sensor) { this->power_sensor_ = power_sensor; }
21 
22  protected:
23  uint16_t manufacture_id_{0};
24  uint16_t device_id_{0};
25 
29 
30  enum ErrorCode {
35  } error_code_{NONE};
36 };
37 
38 } // namespace ina260
39 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
float get_setup_priority() const override
Definition: ina260.h:16
enum esphome::ina260::INA260Component::ErrorCode NONE
This class simplifies creating components that periodically check a state.
Definition: component.h:283
sensor::Sensor * bus_voltage_sensor_
Definition: ina260.h:26
void dump_config() override
Definition: ina260.cpp:65
sensor::Sensor * power_sensor_
Definition: ina260.h:28
void set_power_sensor(sensor::Sensor *power_sensor)
Definition: ina260.h:20
sensor::Sensor * current_sensor_
Definition: ina260.h:27
void set_bus_voltage_sensor(sensor::Sensor *bus_voltage_sensor)
Definition: ina260.h:18
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
void set_current_sensor(sensor::Sensor *current_sensor)
Definition: ina260.h:19