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
+1 -7
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)),
}
)