mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 02:58:11 +01:00
Add raw bus voltage log
This commit is contained in:
parent
01d28ce3fc
commit
f07ea6dcda
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
#include "ina226.h"
|
#include "ina226.h"
|
||||||
#include "esphome/core/log.h"
|
|
||||||
#include "esphome/core/hal.h"
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include "esphome/core/hal.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace ina226 {
|
namespace ina226 {
|
||||||
|
@ -102,6 +102,7 @@ void INA226Component::update() {
|
||||||
this->status_set_warning();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ESP_LOGD(TAG, "Got raw bus voltage: %d", raw_bus_voltage);
|
||||||
float bus_voltage_v = int16_t(raw_bus_voltage) * 0.00125f;
|
float bus_voltage_v = int16_t(raw_bus_voltage) * 0.00125f;
|
||||||
this->bus_voltage_sensor_->publish_state(bus_voltage_v);
|
this->bus_voltage_sensor_->publish_state(bus_voltage_v);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue