1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

fix: update CONFIG_SCHEMA to simplify available_outputs validation by removing voluptuous

This commit is contained in:
Oliver Kleinecke
2025-02-14 19:58:30 +01:00
parent 4f6df9a3af
commit e1c8287504

View File

@@ -1,5 +1,3 @@
import voluptuous as vol
import esphome.codegen as cg # noqa: I001
from esphome.components import output
import esphome.config_validation as cv
@@ -12,7 +10,7 @@ CONF_SAVE_MODE = 'save_mode'
CONF_AVAILABLE_OUTPUTS = 'available_outputs'
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(DynamicLamp),
cv.Required(CONF_AVAILABLE_OUTPUTS): vol.All(cv.ensure_list, [cv.use_id(output.FloatOutput)]),
cv.Required(CONF_AVAILABLE_OUTPUTS): [cv.use_id(output.FloatOutput)],
cv.Optional(CONF_SAVE_MODE, default=0): cv.int_range(0, 1),
}).extend(cv.COMPONENT_SCHEMA)