mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
add SUB_NUMBER macro and schema to number (#4449)
* add SUB_NUMBER macro and schema * add SUB_NUMBER macro and schema * add SUB_NUMBER macro and schema
This commit is contained in:
@@ -46,9 +46,9 @@ def validate(config):
|
||||
|
||||
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
number.NUMBER_SCHEMA.extend(
|
||||
number.number_schema(TemplateNumber)
|
||||
.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(TemplateNumber),
|
||||
cv.Required(CONF_MAX_VALUE): cv.float_,
|
||||
cv.Required(CONF_MIN_VALUE): cv.float_,
|
||||
cv.Required(CONF_STEP): cv.positive_float,
|
||||
@@ -58,7 +58,8 @@ CONFIG_SCHEMA = cv.All(
|
||||
cv.Optional(CONF_INITIAL_VALUE): cv.float_,
|
||||
cv.Optional(CONF_RESTORE_VALUE): cv.boolean,
|
||||
}
|
||||
).extend(cv.polling_component_schema("60s")),
|
||||
)
|
||||
.extend(cv.polling_component_schema("60s")),
|
||||
validate_min_max,
|
||||
validate,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user