1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-21 12:42:21 +01:00

Simplify binary_sensor_schema function (#4469)

This commit is contained in:
Jesse Hills
2023-02-20 10:13:40 +13:00
committed by GitHub
parent 04c12823b5
commit 5c49730cb9
5 changed files with 34 additions and 38 deletions

View File

@@ -6,9 +6,8 @@ from ..display import tm1638_ns, TM1638Component, CONF_TM1638_ID
TM1638Key = tm1638_ns.class_("TM1638Key", binary_sensor.BinarySensor)
CONFIG_SCHEMA = binary_sensor.BINARY_SENSOR_SCHEMA.extend(
CONFIG_SCHEMA = binary_sensor.binary_sensor_schema(TM1638Key).extend(
{
cv.GenerateID(): cv.declare_id(TM1638Key),
cv.GenerateID(CONF_TM1638_ID): cv.use_id(TM1638Component),
cv.Required(CONF_KEY): cv.int_range(min=0, max=15),
}