Add Seeed Studio mmWave Kit MR24HPC1 (#5761)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Peter Pan <twinkle-pirate@hotmail.com>
This commit is contained in:
Citric Lee
2024-03-12 11:33:40 +08:00
committed by GitHub
parent 5b28bd3d97
commit 4bbde8357a
43 changed files with 2330 additions and 0 deletions
@@ -0,0 +1,23 @@
import esphome.codegen as cg
from esphome.components import binary_sensor
import esphome.config_validation as cv
from esphome.const import (
DEVICE_CLASS_OCCUPANCY,
)
from . import CONF_MR24HPC1_ID, MR24HPC1Component
CONF_HAS_TARGET = "has_target"
CONFIG_SCHEMA = {
cv.GenerateID(CONF_MR24HPC1_ID): cv.use_id(MR24HPC1Component),
cv.Optional(CONF_HAS_TARGET): binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_OCCUPANCY, icon="mdi:motion-sensor"
),
}
async def to_code(config):
mr24hpc1_component = await cg.get_variable(config[CONF_MR24HPC1_ID])
if has_target_config := config.get(CONF_HAS_TARGET):
sens = await binary_sensor.new_binary_sensor(has_target_config)
cg.add(mr24hpc1_component.set_has_target_binary_sensor(sens))