mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 10:26:53 +01:00
Fix old-style arduino_version
on ESP8266 and with magic values (#2591)
This commit is contained in:
parent
ed0b34b2fe
commit
115bca98f1
@ -4,7 +4,10 @@ __version__ = "2021.10.1"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
TARGET_PLATFORMS = ["esp32", "esp8266"]
|
||||
PLATFORM_ESP32 = "esp32"
|
||||
PLATFORM_ESP8266 = "esp8266"
|
||||
|
||||
TARGET_PLATFORMS = [PLATFORM_ESP32, PLATFORM_ESP8266]
|
||||
TARGET_FRAMEWORKS = ["arduino", "esp-idf"]
|
||||
|
||||
# See also https://github.com/platformio/platform-espressif8266/releases
|
||||
|
@ -29,6 +29,7 @@ from esphome.const import (
|
||||
CONF_VERSION,
|
||||
KEY_CORE,
|
||||
TARGET_PLATFORMS,
|
||||
PLATFORM_ESP8266,
|
||||
)
|
||||
from esphome.core import CORE, coroutine_with_priority
|
||||
from esphome.helpers import copy_file_if_changed, walk_files
|
||||
@ -182,9 +183,13 @@ def preload_core_config(config, result):
|
||||
if CONF_BOARD_FLASH_MODE in conf:
|
||||
plat_conf[CONF_BOARD_FLASH_MODE] = conf.pop(CONF_BOARD_FLASH_MODE)
|
||||
if CONF_ARDUINO_VERSION in conf:
|
||||
plat_conf[CONF_FRAMEWORK] = {CONF_TYPE: "arduino"}
|
||||
plat_conf[CONF_FRAMEWORK] = {}
|
||||
if plat != PLATFORM_ESP8266:
|
||||
plat_conf[CONF_FRAMEWORK][CONF_TYPE] = "arduino"
|
||||
|
||||
try:
|
||||
cv.Version.parse(conf[CONF_ARDUINO_VERSION])
|
||||
if conf[CONF_ARDUINO_VERSION] not in ("recommended", "latest", "dev"):
|
||||
cv.Version.parse(conf[CONF_ARDUINO_VERSION])
|
||||
plat_conf[CONF_FRAMEWORK][CONF_VERSION] = conf.pop(CONF_ARDUINO_VERSION)
|
||||
except ValueError:
|
||||
plat_conf[CONF_FRAMEWORK][CONF_SOURCE] = conf.pop(CONF_ARDUINO_VERSION)
|
||||
|
Loading…
Reference in New Issue
Block a user