From 04f0ea2a9a912ea54cff54db483d0460e689468c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Jun 2023 12:27:06 -0500 Subject: [PATCH] fix --- components/ratgdo/__init__.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/components/ratgdo/__init__.py b/components/ratgdo/__init__.py index e69de29..c0c4bd4 100644 --- a/components/ratgdo/__init__.py +++ b/components/ratgdo/__init__.py @@ -0,0 +1,25 @@ +import esphome.codegen as cg +import esphome.config_validation as cv +from esphome.const import CONF_ID + +DEPENDENCIES = ["preferences"] + + +ratgdo_ns = cg.esphome_ns.namespace("ratgdo") +RATGDO = ratgdo_ns.class_("RATGDO", cg.Component) + +CONF_ROLLING_CODES = "rolling_codes" + +CONFIG_SCHEMA = cv.Schema( + { + cv.GenerateID(): cv.declare_id(RATGDO), + cv.OPTIONAL(CONF_ROLLING_CODES, default=True): cv.boolean, + } +).extend(cv.COMPONENT_SCHEMA) + + +async def to_code(config): + var = cg.new_Pvariable(config[CONF_ID]) + await cg.register_component(var, config) + # rolling_codes = await cg.get_variable(config[CONF_ROLLING_CODES]) + # cg.add(var.set_microphone(mic))