10 static const float BL0940_PREF = 1430;
11 static const float BL0940_UREF = 33000;
12 static const float BL0940_IREF = 275000;
16 static const float BL0940_EREF = 3.6e6 / 297;
65 internal_temperature_sensor_ = internal_temperature_sensor;
68 external_temperature_sensor_ = external_temperature_sensor;
73 void update()
override;
74 void setup()
override;
75 void dump_config()
override;
88 float max_temperature_diff_{0};
90 float power_reference_ = BL0940_PREF;
92 float voltage_reference_ = BL0940_UREF;
94 float current_reference_ = BL0940_IREF;
96 float energy_reference_ = BL0940_EREF;
104 static bool validate_checksum(
const DataPacket *data);
106 void received_package_(
const DataPacket *data)
const;
void set_voltage_sensor(sensor::Sensor *voltage_sensor)
void set_power_sensor(sensor::Sensor *power_sensor)
This class simplifies creating components that periodically check a state.
void set_external_temperature_sensor(sensor::Sensor *external_temperature_sensor)
void set_current_sensor(sensor::Sensor *current_sensor)
void set_energy_sensor(sensor::Sensor *energy_sensor)
constexpr int32_t to_int32_t(sbe24_t input)
void set_internal_temperature_sensor(sensor::Sensor *internal_temperature_sensor)
esphome::bl0940::BL0940 __attribute__
constexpr uint32_t to_uint32_t(ube24_t input)
Implementation of SPI Controller mode.
Base-class for all sensors.
esphome::sensor::Sensor * sensor