16static constexpr uint32_t STALE_MARGIN_MS = 1000;
22 if (!this->
parent_->is_healthy()) {
30 if (snapshot.
sequence == 0 || age_ms >
static_cast<int32_t
>(2 * this->parent_->get_window_ms() + STALE_MARGIN_MS)) {
35 : snapshot.
rms[this->channel_]);
39 LOG_SENSOR(
"",
"ADS131M0x Sensor",
this);
43 this->
channel_, LOG_STR_ARG(SensorTypeStrings::get_log_str(this->
type_)));
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
ADS131M0xSensorType type_
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
PROGMEM_STRING_TABLE(PowerModeStrings, "very low power", "low power", "high resolution", "unknown")
@ ADS131M0X_SENSOR_TYPE_MEAN
ESPHOME_LOG_TAG(TAG, "ads131m0x")
Application App
Global storage of Application pointer - only one Application can exist.
Result of one measurement window, in volts at the ADC input.
uint32_t sequence
Incremented with every completed window; 0 = no valid data.
std::array< float, MAX_CHANNELS > mean
Mean (DC) value.
std::array< float, MAX_CHANNELS > rms
RMS of the AC component (DC offset removed)
uint32_t timestamp_ms
millis() at the end of the window