esphome/components/nimble_distance_custom/__init__.py

22 lines
674 B
Python
Raw Normal View History

2023-12-03 22:19:57 +03:00
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import nimble_tracker
from esphome.const import (
DEVICE_CLASS_DISTANCE,
STATE_CLASS_MEASUREMENT,
UNIT_METER,
)
DEPENDENCIES = ["nimble_tracker"]
nimble_custom_distance_ns = cg.esphome_ns.namespace("nimble_custom_distance")
NimbleDistanceCustomComponent = nimble_custom_distance_ns.class_(
"NimbleDistanceCustomComponent",
cg.Component,
nimble_tracker.NimbleDeviceListener,
)
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(NimbleDistanceCustomComponent),
}).extend(cv.COMPONENT_SCHEMA).extend(nimble_tracker.NIMBLE_DEVICE_LISTENER_SCHEMA)