ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
motion_event.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::motion {
8
9class MotionEvent : public Component, public event::Event {
10 public:
11 void dump_config() override;
12
13 void set_threshold(float threshold) { this->threshold_ = threshold; }
14 void set_cooldown(uint32_t cooldown) { this->cooldown_ = cooldown; }
15 void process_motion_data(const MotionData &data);
16
17 protected:
18 float threshold_{0.5f};
20
21 // State tracking for shake detection
23 float last_accel_[3]{NAN, NAN, NAN};
24};
25
26} // namespace esphome::motion
void process_motion_data(const MotionData &data)
void set_threshold(float threshold)
void set_cooldown(uint32_t cooldown)
static void uint32_t