1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-06 11:53:45 +01:00

Tidy up switch schemas (#3754)

This commit is contained in:
Jesse Hills
2022-08-31 13:43:46 +12:00
committed by GitHub
parent bd6bc283b6
commit 4d66fab360
17 changed files with 118 additions and 207 deletions

View File

@@ -10,13 +10,7 @@ CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(CustomSwitchConstructor),
cv.Required(CONF_LAMBDA): cv.returning_lambda,
cv.Required(CONF_SWITCHES): cv.ensure_list(
switch.SWITCH_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(switch.Switch),
}
)
),
cv.Required(CONF_SWITCHES): cv.ensure_list(switch.switch_schema(switch.Switch)),
}
)