17 LOG_EVENT(
"",
"Motion Event",
this);
20 " Cooldown: %" PRIu32
" ms",
25 float ax = data.acceleration[X_AXIS];
26 float ay = data.acceleration[Y_AXIS];
27 float az = data.acceleration[Z_AXIS];
28 if (std::isnan(ax) || std::isnan(ay) || std::isnan(az)) {
40 float dy = ay - this->last_accel_[1];
41 float dz = az - this->last_accel_[2];
42 float jerk_mag = std::sqrt(dx * dx + dy * dy + dz * dz);
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.
void trigger(const char *event_type)
Trigger an event; the type is matched against the configured types by string compare.
void add_listener(F &&cb)
void process_motion_data_(const MotionData &data)
uint32_t last_trigger_time_
MotionEvent(MotionComponent *parent)
MotionComponent * parent_
void dump_config() override
ESPHOME_LOG_TAG(TAG, "motion.binary_sensor")
Application App
Global storage of Application pointer - only one Application can exist.