1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-18 19:22:22 +01:00

Simplify button_schema function (#4468)

This commit is contained in:
Jesse Hills
2023-02-20 10:13:37 +13:00
committed by GitHub
parent add40c7652
commit 04c12823b5
4 changed files with 26 additions and 38 deletions

View File

@@ -1,15 +1,10 @@
import esphome.config_validation as cv
from esphome.components import button
from .. import template_ns
TemplateButton = template_ns.class_("TemplateButton", button.Button)
CONFIG_SCHEMA = button.BUTTON_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(TemplateButton),
}
)
CONFIG_SCHEMA = button.button_schema(TemplateButton)
async def to_code(config):