mirror of
https://github.com/esphome/esphome.git
synced 2024-12-28 08:21:44 +01:00
Update __init__.py
This commit is contained in:
parent
3543af84ed
commit
80952aad84
1 changed files with 3 additions and 3 deletions
|
@ -5,13 +5,13 @@ from .. import CONF_LORA, Lora, lora_ns
|
|||
|
||||
LoraSwitch = lora_ns.class_("LoraSwitch", switch.Switch, cg.Component)
|
||||
|
||||
CONF_LORA_PIN = "pin_to_send"
|
||||
PIN_TO_SEND = "pin_to_send"
|
||||
CONFIG_SCHEMA = (
|
||||
switch.switch_schema(LoraSwitch, block_inverted=True)
|
||||
.extend(
|
||||
{
|
||||
cv.Required(CONF_LORA): cv.use_id(Lora),
|
||||
cv.Required(CONF_LORA_PIN): cv.int_range(min=1, max=256),
|
||||
cv.Required(PIN_TO_SEND): cv.int_range(min=1, max=256),
|
||||
}
|
||||
)
|
||||
.extend(cv.COMPONENT_SCHEMA)
|
||||
|
@ -23,4 +23,4 @@ async def to_code(config):
|
|||
parent = await cg.get_variable(config[CONF_LORA])
|
||||
await cg.register_component(var, config)
|
||||
cg.add(var.set_parent(parent))
|
||||
cg.add(var.set_pin(config[CONF_LORA_PIN]))
|
||||
cg.add(var.set_pin(config[PIN_TO_SEND]))
|
||||
|
|
Loading…
Reference in a new issue