mirror of
https://github.com/esphome/esphome.git
synced 2024-12-12 08:24:55 +01:00
add custom_platform
This commit is contained in:
parent
22478ffb0f
commit
c8e4b4cf4f
1 changed files with 5 additions and 0 deletions
|
@ -113,6 +113,7 @@ else:
|
||||||
|
|
||||||
|
|
||||||
CONF_ESP8266_RESTORE_FROM_FLASH = "esp8266_restore_from_flash"
|
CONF_ESP8266_RESTORE_FROM_FLASH = "esp8266_restore_from_flash"
|
||||||
|
CONF_CUSTOM_PLATFORM = "custom_platform"
|
||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.Schema(
|
cv.Schema(
|
||||||
{
|
{
|
||||||
|
@ -167,6 +168,7 @@ CONFIG_SCHEMA = cv.All(
|
||||||
cv.Optional(
|
cv.Optional(
|
||||||
CONF_COMPILE_PROCESS_LIMIT, default=_compile_process_limit_default
|
CONF_COMPILE_PROCESS_LIMIT, default=_compile_process_limit_default
|
||||||
): cv.int_range(min=1, max=multiprocessing.cpu_count()),
|
): cv.int_range(min=1, max=multiprocessing.cpu_count()),
|
||||||
|
cv.Optional(CONF_CUSTOM_PLATFORM): cv.string,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
validate_hostname,
|
validate_hostname,
|
||||||
|
@ -202,6 +204,9 @@ def preload_core_config(config, result):
|
||||||
conf[CONF_BUILD_PATH] = os.path.join(build_path, CORE.name)
|
conf[CONF_BUILD_PATH] = os.path.join(build_path, CORE.name)
|
||||||
CORE.build_path = CORE.relative_internal_path(conf[CONF_BUILD_PATH])
|
CORE.build_path = CORE.relative_internal_path(conf[CONF_BUILD_PATH])
|
||||||
|
|
||||||
|
if conf.get(CONF_CUSTOM_PLATFORM):
|
||||||
|
TARGET_PLATFORMS.extend([conf.get(CONF_CUSTOM_PLATFORM)])
|
||||||
|
|
||||||
has_oldstyle = CONF_PLATFORM in conf
|
has_oldstyle = CONF_PLATFORM in conf
|
||||||
newstyle_found = [key for key in TARGET_PLATFORMS if key in config]
|
newstyle_found = [key for key in TARGET_PLATFORMS if key in config]
|
||||||
oldstyle_opts = [
|
oldstyle_opts = [
|
||||||
|
|
Loading…
Reference in a new issue