mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
Fix old-style arduino_version
on ESP8266 and with magic values (#2591)
This commit is contained in:
parent
ed0b34b2fe
commit
115bca98f1
2 changed files with 11 additions and 3 deletions
|
@ -4,7 +4,10 @@ __version__ = "2021.10.1"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
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"]
|
TARGET_FRAMEWORKS = ["arduino", "esp-idf"]
|
||||||
|
|
||||||
# See also https://github.com/platformio/platform-espressif8266/releases
|
# See also https://github.com/platformio/platform-espressif8266/releases
|
||||||
|
|
|
@ -29,6 +29,7 @@ from esphome.const import (
|
||||||
CONF_VERSION,
|
CONF_VERSION,
|
||||||
KEY_CORE,
|
KEY_CORE,
|
||||||
TARGET_PLATFORMS,
|
TARGET_PLATFORMS,
|
||||||
|
PLATFORM_ESP8266,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.helpers import copy_file_if_changed, walk_files
|
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:
|
if CONF_BOARD_FLASH_MODE in conf:
|
||||||
plat_conf[CONF_BOARD_FLASH_MODE] = conf.pop(CONF_BOARD_FLASH_MODE)
|
plat_conf[CONF_BOARD_FLASH_MODE] = conf.pop(CONF_BOARD_FLASH_MODE)
|
||||||
if CONF_ARDUINO_VERSION in conf:
|
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:
|
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)
|
plat_conf[CONF_FRAMEWORK][CONF_VERSION] = conf.pop(CONF_ARDUINO_VERSION)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
plat_conf[CONF_FRAMEWORK][CONF_SOURCE] = conf.pop(CONF_ARDUINO_VERSION)
|
plat_conf[CONF_FRAMEWORK][CONF_SOURCE] = conf.pop(CONF_ARDUINO_VERSION)
|
||||||
|
|
Loading…
Reference in a new issue