esphome-ratgdo/components/ratgdo/cover/__init__.py

23 lines
644 B
Python
Raw Normal View History

2023-06-07 16:56:55 +00:00
import esphome.codegen as cg
from esphome.const import CONF_ID
2023-06-07 16:59:17 +00:00
import esphome.config_validation as cv
2023-06-07 16:56:55 +00:00
from esphome.components import cover
2023-06-07 23:49:13 +00:00
from .. import ratgdo_ns, register_ratgdo_child, RATGDO_CLIENT_SCHMEA
2023-06-07 16:56:55 +00:00
DEPENDENCIES = ["ratgdo"]
2023-06-07 23:49:13 +00:00
RATGDOCover = ratgdo_ns.class_("RATGDOCover", cover.Cover, cg.Component)
2023-06-07 16:56:55 +00:00
2023-06-07 23:49:13 +00:00
CONFIG_SCHEMA = cover.COVER_SCHEMA.extend(
{cv.GenerateID(): cv.declare_id(RATGDOCover)}
).extend(RATGDO_CLIENT_SCHMEA)
2023-06-07 16:56:55 +00:00
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
2023-06-07 17:03:17 +00:00
await cover.register_cover(var, config)
2023-06-07 16:56:55 +00:00
await register_ratgdo_child(var, config)