72#ifdef USE_BINARY_SENSOR
73 SUB_BINARY_SENSOR(out_pin_presence_status)
74 SUB_BINARY_SENSOR(moving_target)
75 SUB_BINARY_SENSOR(still_target)
76 SUB_BINARY_SENSOR(target)
77 SUB_BINARY_SENSOR(calibration)
80 SUB_SENSOR_WITH_DEDUP(light, uint8_t)
81 SUB_SENSOR_WITH_DEDUP(detection_distance,
int)
82 SUB_SENSOR_WITH_DEDUP(moving_target_distance,
int)
83 SUB_SENSOR_WITH_DEDUP(moving_target_energy, uint8_t)
84 SUB_SENSOR_WITH_DEDUP(still_target_distance,
int)
85 SUB_SENSOR_WITH_DEDUP(still_target_energy, uint8_t)
88 SUB_TEXT_SENSOR(version)
90 SUB_TEXT_SENSOR(calibration_result)
93 SUB_NUMBER(light_threshold)
94 SUB_NUMBER(max_move_distance_gate)
95 SUB_NUMBER(max_still_distance_gate)
100 SUB_SELECT(distance_resolution)
101 SUB_SELECT(light_function)
102 SUB_SELECT(out_pin_level)
105 SUB_SWITCH(bluetooth)
106 SUB_SWITCH(engineering_mode)
109 SUB_BUTTON(factory_reset)
112 SUB_BUTTON(background_correction)
116 void setup()
override;
117 void dump_config()
override;
118 void loop()
override;
119 void set_light_out_control();
121 void set_gate_still_threshold_number(uint8_t gate,
number::Number *n);
122 void set_gate_move_threshold_number(uint8_t gate,
number::Number *n);
123 void set_max_distances_timeout();
130 void set_bluetooth_password(
const std::string &password);
131 void set_engineering_mode(
bool enable);
132 void read_all_info();
133 void restart_and_read_all_info();
134 void set_bluetooth(
bool enable);
135 void set_distance_resolution(
const char *
state);
137 void set_baud_rate(
const char *
state);
139 void factory_reset();
140#ifdef USE_LD2410_BG_CORRECTION
142 void start_background_correction();
146 void send_command_(uint8_t command_str,
const uint8_t *command_value, uint8_t command_value_len);
158#ifdef USE_LD2410_BG_CORRECTION
172#ifdef USE_LD2410_BG_CORRECTION