ESPHome  2022.6.3
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:18
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:266
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
Definition: a4988.cpp:4
Base-class for all sensors.
Definition: sensor.h:47
void set_current_sensor(sensor::Sensor *current_sensor)
Definition: ina260.h:19