Add ld2450 tests

This commit is contained in:
Hareesh M U 2023-11-04 10:11:09 +00:00
parent a0eafd3629
commit 5851006929
3 changed files with 134 additions and 1 deletions

View file

@ -7,13 +7,13 @@ from esphome.const import (
ENTITY_CATEGORY_CONFIG,
ICON_RESTART,
ICON_RESTART_ALERT,
CONF_FACTORY_RESET,
)
from .. import CONF_LD2450_ID, LD2450Component, ld2450_ns
ResetButton = ld2450_ns.class_("ResetButton", button.Button)
RestartButton = ld2450_ns.class_("RestartButton", button.Button)
CONF_FACTORY_RESET = "factory_reset"
CONF_RESTART = "restart"
CONFIG_SCHEMA = {

View file

@ -248,6 +248,7 @@ CONF_EXPORT_REACTIVE_ENERGY = "export_reactive_energy"
CONF_EXTERNAL_CLOCK_INPUT = "external_clock_input"
CONF_EXTERNAL_COMPONENTS = "external_components"
CONF_EXTERNAL_VCC = "external_vcc"
CONF_FACTORY_RESET = "factory_reset"
CONF_FALLING_EDGE = "falling_edge"
CONF_FAMILY = "family"
CONF_FAN_MODE = "fan_mode"

View file

@ -263,6 +263,12 @@ uart:
rx_pin: GPIO10
parity: EVEN
baud_rate: 9600
- id: uart_ld2450
tx_pin: 18
rx_pin: 23
baud_rate: 256000
parity: NONE
stop_bits: 1
ota:
safe_mode: true
@ -1648,6 +1654,53 @@ sensor:
memory_location: 0x20
memory_address: 0x7d
name: Adres sensor
- platform: ld2450
ld2450_id: ld2450_radar
target_count:
name: Presence Target Count
still_target_count:
name: Still Target Count
moving_target_count:
name: Moving Target Count
target_1:
x:
name: Target-1 X
y:
name: Target-1 Y
speed:
name: Target-1 Speed
angle:
name: Target-1 Angle
distance:
name: Target-1 Distance
resolution:
name: Target-1 Resolution
target_2:
x:
name: Target-2 X
y:
name: Target-2 Y
speed:
name: Target-2 Speed
angle:
name: Target-2 Angle
distance:
name: Target-2 Distance
resolution:
name: Target-2 Resolution
target_3:
x:
name: Target-3 X
y:
name: Target-3 Y
speed:
name: Target-3 Speed
angle:
name: Target-3 Angle
distance:
name: Target-3 Distance
resolution:
name: Target-3 Resolution
psram:
@ -1986,6 +2039,14 @@ binary_sensor:
- platform: dfrobot_sen0395
id: mmwave_detected_uart
dfrobot_sen0395_id: mmwave
- platform: ld2450
ld2450_id: ld2450_radar
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
pca9685:
frequency: 500
@ -2920,6 +2981,12 @@ switch:
- platform: micronova
stove:
name: Stove on/off
- platform: ld2450
ld2450_id: ld2450_radar
bluetooth:
name: "Bluetooth"
multi_target:
name: "Multi Target Tracking"
fan:
- platform: binary
@ -3746,6 +3813,21 @@ text_sensor:
name: "presenece sensor version"
mac_address:
name: "presenece sensor mac address"
- platform: ld2450
ld2450_id: ld2450_radar
version:
name: "LD2450 Firmware"
mac_address:
name: "LD2450 BT MAC"
target_1:
direction:
name: "Target-1 Direction"
target_2:
direction:
name: "Target-2 Direction"
target_3:
direction:
name: "Target-3 Direction"
sn74hc595:
- id: sn74hc595_hub
@ -3936,6 +4018,37 @@ number:
step: 1
power_level:
name: Micronova Power level
- platform: ld2450
ld2450_id: ld2450_radar
presence_timeout:
name: "Timeout"
zone_1:
x1:
name: Zone-1 X1
y1:
name: Zone-1 Y1
x2:
name: Zone-1 X2
y2:
name: Zone-1 Y2
zone_2:
x1:
name: Zone-2 X1
y1:
name: Zone-2 Y1
x2:
name: Zone-2 X2
y2:
name: Zone-2 Y2
zone_3:
x1:
name: Zone-3 X1
y1:
name: Zone-3 Y1
x2:
name: Zone-3 X2
y2:
name: Zone-3 Y2
select:
- platform: template
@ -3958,6 +4071,12 @@ select:
name: light function
out_pin_level:
name: out ping level
- platform: ld2450
ld2450_id: ld2450_radar
baud_rate:
name: "Baud rate"
zone_type:
name: "Zone Type"
qr_code:
- id: homepage_qr
@ -4072,6 +4191,14 @@ button:
memory_location: 0xA0
memory_address: 0x7D
memory_data: 0x0F
- platform: ld2450
ld2450_id: ld2450_radar
factory_reset:
name: "LD2450 Factory Reset"
entity_category: "config"
restart:
name: "LD2450 Restart"
entity_category: "config"
ld2410:
id: my_ld2410
@ -4081,6 +4208,11 @@ ld2420:
id: my_ld2420
uart_id: ld2420_uart
ld2450:
id: ld2450_radar
uart_id: uart_ld2450
throttle: 1000ms
lcd_menu:
id: test_lcd_menu
display_id: my_lcd_gpio