ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
ld6004.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome::ld6004 {
6
7enum LD6004ButtonType : uint8_t {
8 BUTTON_CLEAR_DWELL = ld600x::LD600X_MODEL_KIND_BASE,
9};
10
12 public:
13 LD6004Component() : LD600XComponent(LOG_STR("ld6004")) {}
14
15#ifdef USE_NUMBER
16 SUB_NUMBER(dwell_lifetime)
17 SUB_NUMBER(output_interval)
18#endif
19#ifdef USE_SELECT
20 SUB_SELECT(work_mode)
21 SUB_SELECT(p20_mode)
22#endif
23
24#ifdef USE_NUMBER
25 bool set_number_value(number::Number *entity, float value) override;
26#endif
27#ifdef USE_SELECT
28 bool set_select_value(select::Select *entity, size_t index) override;
29#endif
30#ifdef USE_BUTTON
31 void press_button(uint8_t kind) override;
32#endif
33
34 protected:
35 bool handle_model_report(uint16_t type, const uint8_t *data, uint16_t len) override;
36 void setup_model() override;
37 void dump_model_config() override;
38
39 // Set by a work mode report that turns the radar off, and cleared by one that turns it back on.
40 bool radar_off_{false};
41};
42
43} // namespace esphome::ld6004
SUB_NUMBER(dwell_lifetime) SUB_NUMBER(output_interval) SUB_SELECT(work_mode) SUB_SELECT(p20_mode) bool set_number_value(number bool set_select_value(select::Select *entity, size_t index) override
Definition ld6004.cpp:138
bool handle_model_report(uint16_t type, const uint8_t *data, uint16_t len) override
Definition ld6004.cpp:68
void dump_model_config() override
Definition ld6004.cpp:181
void press_button(uint8_t kind) override
Definition ld6004.cpp:148
LD600XComponent(const LogString *log_tag)
Definition ld600x.h:109
Base-class for all numbers.
Definition number.h:29
Base-class for all selects.
Definition select.h:28
uint8_t type
@ BUTTON_CLEAR_DWELL
Definition ld6004.h:8
uint32_t value
Definition hal.cpp:41
const void size_t len
Definition hal.h:68