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

24 lines
648 B
Python
Raw Normal View History

2023-06-09 20:54:20 +00:00
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import lock
2023-06-09 20:54:28 +00:00
from esphome.const import CONF_ID
from .. import RATGDO_CLIENT_SCHMEA, ratgdo_ns, register_ratgdo_child
2023-06-09 20:54:20 +00:00
DEPENDENCIES = ["ratgdo"]
RATGDOLock = ratgdo_ns.class_("RATGDOLock", lock.Lock, cg.Component)
2023-06-09 20:54:20 +00:00
CONFIG_SCHEMA = lock.LOCK_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(RATGDOLock),
}
).extend(RATGDO_CLIENT_SCHMEA)
2023-06-09 20:54:20 +00:00
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await lock.register_lock(var, config)
2023-06-09 20:54:20 +00:00
await cg.register_component(var, config)
await register_ratgdo_child(var, config)