forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for LibreTiny platform (RTL8710, BK7231 & other modules) (esp…
…home#3509) Co-authored-by: Kuba Szczodrzyński <[email protected]> Co-authored-by: Sam Neirinck <[email protected]> Co-authored-by: David Buezas <[email protected]> Co-authored-by: Stroe Andrei Catalin <[email protected]> Co-authored-by: Sam Neirinck <[email protected]> Co-authored-by: Péter Sárközi <[email protected]> Co-authored-by: Hajo Noerenberg <[email protected]>
- Loading branch information
1 parent
22c0b0a
commit a9630ac
Showing
78 changed files
with
6,084 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 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. | ||
|
||
from esphome import pins | ||
from esphome.components import libretiny | ||
from esphome.components.libretiny.const import ( | ||
COMPONENT_BK72XX, | ||
KEY_COMPONENT_DATA, | ||
KEY_LIBRETINY, | ||
LibreTinyComponent, | ||
) | ||
from esphome.core import CORE | ||
|
||
from .boards import BK72XX_BOARDS, BK72XX_BOARD_PINS | ||
|
||
CODEOWNERS = ["@kuba2k2"] | ||
AUTO_LOAD = ["libretiny"] | ||
|
||
COMPONENT_DATA = LibreTinyComponent( | ||
name=COMPONENT_BK72XX, | ||
boards=BK72XX_BOARDS, | ||
board_pins=BK72XX_BOARD_PINS, | ||
pin_validation=None, | ||
usage_validation=None, | ||
) | ||
|
||
|
||
def _set_core_data(config): | ||
CORE.data[KEY_LIBRETINY] = {} | ||
CORE.data[KEY_LIBRETINY][KEY_COMPONENT_DATA] = COMPONENT_DATA | ||
return config | ||
|
||
|
||
CONFIG_SCHEMA = libretiny.BASE_SCHEMA | ||
|
||
PIN_SCHEMA = libretiny.gpio.BASE_PIN_SCHEMA | ||
|
||
CONFIG_SCHEMA.prepend_extra(_set_core_data) | ||
|
||
|
||
async def to_code(config): | ||
return await libretiny.component_to_code(config) | ||
|
||
|
||
@pins.PIN_SCHEMA_REGISTRY.register("bk72xx", PIN_SCHEMA) | ||
async def pin_to_code(config): | ||
return await libretiny.gpio.component_pin_to_code(config) |
Oops, something went wrong.