1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +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:
Regev Brody
2023-02-19 21:54:00 +02:00
committed by GitHub
parent 40e2832e67
commit e68beb8a43
7 changed files with 77 additions and 18 deletions

View File

@@ -284,9 +284,10 @@ CONFIG_SCHEMA = cv.Schema(
},
],
): [
number.NUMBER_SCHEMA.extend(cv.COMPONENT_SCHEMA).extend(
number.number_schema(DemoNumber)
.extend(cv.COMPONENT_SCHEMA)
.extend(
{
cv.GenerateID(): cv.declare_id(DemoNumber),
cv.Required(CONF_TYPE): cv.enum(NUMBER_TYPES, int=True),
cv.Required(CONF_MIN_VALUE): cv.float_,
cv.Required(CONF_MAX_VALUE): cv.float_,