From 8aff0e7bfeb825cc85a1c863a844b7bba58d25e4 Mon Sep 17 00:00:00 2001 From: tetele Date: Fri, 2 Aug 2024 12:26:26 +0300 Subject: [PATCH] Oh ffs --- esphome/components/es8388/__init__.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/esphome/components/es8388/__init__.py b/esphome/components/es8388/__init__.py index 0647685025..3f5833e5ef 100644 --- a/esphome/components/es8388/__init__.py +++ b/esphome/components/es8388/__init__.py @@ -31,17 +31,19 @@ def validate_instruction_list(): CONFIG_SCHEMA = ( - cv.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.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(), + } + ), + } + ) .extend(i2c.i2c_device_schema(0x10)) .extend(cv.COMPONENT_SCHEMA) ) @@ -63,7 +65,7 @@ async def to_code(config): { 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]))