import esphome.config_validation as cv import esphome.codegen as cg from esphome.const import ( CONF_ACTIVE, CONF_ID, CONF_INTERVAL, CONF_DURATION, ) DEPENDENCIES = ["esp32"] nimble_tracker_ns = cg.esphome_ns.namespace("my_nimble_tracker") NimbleTracker = nimble_tracker_ns.class_("MyNimbleTracker", cg.Component) CONFIG_SCHEMA = cv.Schema({ cv.GenerateID(): cv.declare_id(NimbleTracker), cv.Optional(CONF_ACTIVE, default=True): cv.boolean, }).extend(cv.COMPONENT_SCHEMA) cg.add_library( name="NimBLE", repository="https://github.com/h2zero/NimBLE-Arduino.git", version="release/1.4", ) def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) yield cg.register_component(var, config) #cg.add(var.set_my_required_key(config[CONF_MY_REQUIRED_KEY]))