diff --git a/esphome/components/bk72xx/__init__.py b/esphome/components/bk72xx/__init__.py index cb7003a2e42..7fed742d2e2 100644 --- a/esphome/components/bk72xx/__init__.py +++ b/esphome/components/bk72xx/__init__.py @@ -1,9 +1,23 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. -# For custom pin validators, put validate_pin() or validate_usage() -# in gpio.py file in this directory. -# For changing schema/pin schema, put COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA -# in schema.py file in this directory. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. + +To customize this component: + - Pin validators: Create gpio.py with validate_pin() or validate_usage() + - Schema extensions: Create schema.py with COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA + +Platform-specific code should be added to the main libretiny component +(__init__.py in esphome/components/libretiny/) rather than here. +""" from esphome import pins from esphome.components import libretiny diff --git a/esphome/components/bk72xx/boards.py b/esphome/components/bk72xx/boards.py index 3bf93d24347..3850dbe2667 100644 --- a/esphome/components/bk72xx/boards.py +++ b/esphome/components/bk72xx/boards.py @@ -1,5 +1,16 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. +""" from esphome.components.libretiny.const import ( FAMILY_BK7231N, diff --git a/esphome/components/libretiny/generate_components.py b/esphome/components/libretiny/generate_components.py index dbd58110e44..41b43894465 100644 --- a/esphome/components/libretiny/generate_components.py +++ b/esphome/components/libretiny/generate_components.py @@ -11,13 +11,27 @@ from black import FileMode, format_str from ltchiptool import Board, Family from ltchiptool.util.lvm import LVM -BASE_CODE_INIT = """ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. -# For custom pin validators, put validate_pin() or validate_usage() -# in gpio.py file in this directory. -# For changing schema/pin schema, put COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA -# in schema.py file in this directory. +BASE_CODE_INIT = ''' +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. + +To customize this component: + - Pin validators: Create gpio.py with validate_pin() or validate_usage() + - Schema extensions: Create schema.py with COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA + +Platform-specific code should be added to the main libretiny component +(__init__.py in esphome/components/libretiny/) rather than here. +""" from esphome import pins from esphome.components import libretiny @@ -31,7 +45,7 @@ from esphome.core import CORE {IMPORTS} -CODEOWNERS = ["@kuba2k2"] +CODEOWNERS = {CODEOWNERS} AUTO_LOAD = ["libretiny"] IS_TARGET_PLATFORM = True @@ -65,11 +79,22 @@ async def to_code(config): @pins.PIN_SCHEMA_REGISTRY.register("{COMPONENT_LOWER}", PIN_SCHEMA) async def pin_to_code(config): return await libretiny.gpio.component_pin_to_code(config) -""" +''' -BASE_CODE_BOARDS = """ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. +BASE_CODE_BOARDS = ''' +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. +""" from esphome.components.libretiny.const import {FAMILIES} @@ -78,7 +103,7 @@ from esphome.components.libretiny.const import {FAMILIES} {COMPONENT}_BOARD_PINS = {PINS_JSON} BOARDS = {COMPONENT}_BOARDS -""" +''' # variable names in component extension code VAR_SCHEMA = "COMPONENT_SCHEMA" @@ -107,6 +132,11 @@ COMPONENT_SUPPORTS_ATOMICS = { "bk72xx": False, # ARM968E-S } +# CODEOWNERS for each component. If not specified, defaults to @kuba2k2. +COMPONENT_CODEOWNERS = { + "ln882x": ["@lamauny"], +} + def subst(code: str, key: str, value: str) -> str: return code.replace(f"{{{key}}}", value) @@ -150,6 +180,7 @@ def write_component_code( "boards": {"{COMPONENT}_BOARDS", "{COMPONENT}_BOARD_PINS"}, } # substitution values + codeowners = COMPONENT_CODEOWNERS.get(component, ["@kuba2k2"]) values = dict( COMPONENT=component.upper(), COMPONENT_LOWER=component.lower(), @@ -158,6 +189,7 @@ def write_component_code( PIN_VALIDATION="None", USAGE_VALIDATION="None", SUPPORTS_ATOMICS=str(COMPONENT_SUPPORTS_ATOMICS.get(component, False)), + CODEOWNERS=repr(codeowners), ) # parse gpio.py file to find custom validators diff --git a/esphome/components/ln882x/__init__.py b/esphome/components/ln882x/__init__.py index 899172f9868..5c637bdf629 100644 --- a/esphome/components/ln882x/__init__.py +++ b/esphome/components/ln882x/__init__.py @@ -1,9 +1,23 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. -# For custom pin validators, put validate_pin() or validate_usage() -# in gpio.py file in this directory. -# For changing schema/pin schema, put COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA -# in schema.py file in this directory. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. + +To customize this component: + - Pin validators: Create gpio.py with validate_pin() or validate_usage() + - Schema extensions: Create schema.py with COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA + +Platform-specific code should be added to the main libretiny component +(__init__.py in esphome/components/libretiny/) rather than here. +""" from esphome import pins from esphome.components import libretiny @@ -17,7 +31,7 @@ from esphome.core import CORE from .boards import LN882X_BOARD_PINS, LN882X_BOARDS -CODEOWNERS = ["@kuba2k2"] +CODEOWNERS = ["@lamauny"] AUTO_LOAD = ["libretiny"] IS_TARGET_PLATFORM = True diff --git a/esphome/components/ln882x/boards.py b/esphome/components/ln882x/boards.py index b357d6a7b66..600371951d8 100644 --- a/esphome/components/ln882x/boards.py +++ b/esphome/components/ln882x/boards.py @@ -1,5 +1,16 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. +""" from esphome.components.libretiny.const import FAMILY_LN882H diff --git a/esphome/components/rtl87xx/__init__.py b/esphome/components/rtl87xx/__init__.py index 3f737d3840f..6fd750d51ed 100644 --- a/esphome/components/rtl87xx/__init__.py +++ b/esphome/components/rtl87xx/__init__.py @@ -1,9 +1,23 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. -# For custom pin validators, put validate_pin() or validate_usage() -# in gpio.py file in this directory. -# For changing schema/pin schema, put COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA -# in schema.py file in this directory. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. + +To customize this component: + - Pin validators: Create gpio.py with validate_pin() or validate_usage() + - Schema extensions: Create schema.py with COMPONENT_SCHEMA or COMPONENT_PIN_SCHEMA + +Platform-specific code should be added to the main libretiny component +(__init__.py in esphome/components/libretiny/) rather than here. +""" from esphome import pins from esphome.components import libretiny diff --git a/esphome/components/rtl87xx/boards.py b/esphome/components/rtl87xx/boards.py index 18a242942a1..5a3228fb1d3 100644 --- a/esphome/components/rtl87xx/boards.py +++ b/esphome/components/rtl87xx/boards.py @@ -1,5 +1,16 @@ -# This file was auto-generated by libretiny/generate_components.py -# Do not modify its contents. +""" +██╗ ██╗ █████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗ ██████╗ +██║ ██║██╔══██╗██╔══██╗████╗ ██║██║████╗ ██║██╔════╝ +██║ █╗ ██║███████║██████╔╝██╔██╗ ██║██║██╔██╗ ██║██║ ███╗ +██║███╗██║██╔══██║██╔══██╗██║╚██╗██║██║██║╚██╗██║██║ ██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ╚████║██║██║ ╚████║╚██████╔╝ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═════╝ + + AUTO-GENERATED FILE - DO NOT EDIT! + +This file was auto-generated by libretiny/generate_components.py. +Any manual changes WILL BE LOST on regeneration. +""" from esphome.components.libretiny.const import FAMILY_RTL8710B, FAMILY_RTL8720C