From 68a1b6bc0262700afc7df0965881e274dc56c728 Mon Sep 17 00:00:00 2001 From: tetele Date: Fri, 2 Aug 2024 12:23:32 +0300 Subject: [PATCH] Linting --- esphome/components/es8388/__init__.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/esphome/components/es8388/__init__.py b/esphome/components/es8388/__init__.py index 1e0b011190..0647685025 100644 --- a/esphome/components/es8388/__init__.py +++ b/esphome/components/es8388/__init__.py @@ -27,10 +27,7 @@ ES8388_PRESETS = { def validate_instruction_list(): - return cv.ensure_list( - cv.Length(min=2, max=2), - cv.ensure_list(int) - ) + return cv.ensure_list(cv.Length(min=2, max=2), cv.ensure_list(int)) CONFIG_SCHEMA = ( @@ -38,10 +35,12 @@ CONFIG_SCHEMA = ( cv.GenerateID(): cv.declare_id(ES8388Component), cv.Optional(CONF_PRESET): cv.enum(ES8388_PRESETS, lower=True), cv.Optional(CONF_INIT_INSTRUCTIONS): validate_instruction_list(), - cv.Optional(CONF_MACROS): cv.ensure_list({ - cv.Required(CONF_ID): cv.string, - cv.Required(CONF_INSTRUCTIONS): validate_instruction_list(), - }), + cv.Optional(CONF_MACROS): cv.ensure_list( + { + cv.Required(CONF_ID): cv.string, + cv.Required(CONF_INSTRUCTIONS): validate_instruction_list(), + } + ), }) .extend(i2c.i2c_device_schema(0x10)) .extend(cv.COMPONENT_SCHEMA) @@ -58,10 +57,14 @@ async def to_code(config): cg.add(var.set_init_instructions(config[CONF_INIT_INSTRUCTIONS])) if CONF_MACROS in config: for macro in config[CONF_MACROS]: - ES8388_MACROS.register(macro[CONF_ID], Macro, { - cv.Required(CONF_ID): cv.declare_id(Macro), - cv.Required(CONF_INSTRUCTIONS): validate_instruction_list(), - }) + ES8388_MACROS.register( + macro[CONF_ID], + Macro, + { + cv.Required(CONF_ID): cv.declare_id(Macro), + cv.Required(CONF_INSTRUCTIONS): validate_instruction_list(), + } + ) cg.add(var.register_macro(macro[CONF_ID], macro[CONF_INSTRUCTIONS]))