From a3ed0905942b2111dd0ec456fcfc81246ab15eb0 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 13 May 2025 08:59:59 +1200 Subject: [PATCH] [tm1638] Use switch_schema method (#8758) --- esphome/components/tm1638/switch/__init__.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/esphome/components/tm1638/switch/__init__.py b/esphome/components/tm1638/switch/__init__.py index 8832cf8b92..90ff87938c 100644 --- a/esphome/components/tm1638/switch/__init__.py +++ b/esphome/components/tm1638/switch/__init__.py @@ -8,13 +8,16 @@ from ..display import CONF_TM1638_ID, TM1638Component, tm1638_ns TM1638SwitchLed = tm1638_ns.class_("TM1638SwitchLed", switch.Switch, cg.Component) -CONFIG_SCHEMA = switch.SWITCH_SCHEMA.extend( - { - cv.GenerateID(): cv.declare_id(TM1638SwitchLed), - cv.GenerateID(CONF_TM1638_ID): cv.use_id(TM1638Component), - cv.Required(CONF_LED): cv.int_range(min=0, max=7), - } -).extend(cv.COMPONENT_SCHEMA) +CONFIG_SCHEMA = ( + switch.switch_schema(TM1638SwitchLed) + .extend( + { + cv.GenerateID(CONF_TM1638_ID): cv.use_id(TM1638Component), + cv.Required(CONF_LED): cv.int_range(min=0, max=7), + } + ) + .extend(cv.COMPONENT_SCHEMA) +) async def to_code(config):