mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
[tm1638] Use switch_schema method (#8758)
This commit is contained in:
parent
cff1820772
commit
a3ed090594
@ -8,13 +8,16 @@ from ..display import CONF_TM1638_ID, TM1638Component, tm1638_ns
|
|||||||
TM1638SwitchLed = tm1638_ns.class_("TM1638SwitchLed", switch.Switch, cg.Component)
|
TM1638SwitchLed = tm1638_ns.class_("TM1638SwitchLed", switch.Switch, cg.Component)
|
||||||
|
|
||||||
|
|
||||||
CONFIG_SCHEMA = switch.SWITCH_SCHEMA.extend(
|
CONFIG_SCHEMA = (
|
||||||
{
|
switch.switch_schema(TM1638SwitchLed)
|
||||||
cv.GenerateID(): cv.declare_id(TM1638SwitchLed),
|
.extend(
|
||||||
cv.GenerateID(CONF_TM1638_ID): cv.use_id(TM1638Component),
|
{
|
||||||
cv.Required(CONF_LED): cv.int_range(min=0, max=7),
|
cv.GenerateID(CONF_TM1638_ID): cv.use_id(TM1638Component),
|
||||||
}
|
cv.Required(CONF_LED): cv.int_range(min=0, max=7),
|
||||||
).extend(cv.COMPONENT_SCHEMA)
|
}
|
||||||
|
)
|
||||||
|
.extend(cv.COMPONENT_SCHEMA)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user