1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-21 04:18:16 +00:00
niklasweber 907d43827c
Add dfrobot_sen0395 mmwave radar component (#4203)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-10-27 17:56:33 +13:00

23 lines
677 B
Python

import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from esphome.const import DEVICE_CLASS_MOTION
from . import CONF_DFROBOT_SEN0395_ID, DfrobotSen0395Component
DEPENDENCIES = ["dfrobot_sen0395"]
CONFIG_SCHEMA = binary_sensor.binary_sensor_schema(
device_class=DEVICE_CLASS_MOTION
).extend(
{
cv.GenerateID(CONF_DFROBOT_SEN0395_ID): cv.use_id(DfrobotSen0395Component),
}
)
async def to_code(config):
parent = await cg.get_variable(config[CONF_DFROBOT_SEN0395_ID])
binary_sens = await binary_sensor.new_binary_sensor(config)
cg.add(parent.set_detected_binary_sensor(binary_sens))