mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 06:58:11 +01:00
Limit upload speed to 115200 (#122)
* Limit upload speed to 115200 * Lint
This commit is contained in:
parent
8dba37846b
commit
5e5137960d
1 changed files with 9 additions and 3 deletions
|
@ -7,9 +7,9 @@ import os
|
||||||
|
|
||||||
from esphomeyaml import core
|
from esphomeyaml import core
|
||||||
from esphomeyaml.config import iter_components
|
from esphomeyaml.config import iter_components
|
||||||
from esphomeyaml.const import CONF_ARDUINO_VERSION, CONF_BOARD, CONF_BOARD_FLASH_MODE, \
|
from esphomeyaml.const import ARDUINO_VERSION_ESP32_DEV, CONF_ARDUINO_VERSION, CONF_BOARD, \
|
||||||
CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, CONF_LOCAL, CONF_NAME, CONF_USE_CUSTOM_CODE, \
|
CONF_BOARD_FLASH_MODE, CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, CONF_LOCAL, CONF_NAME, \
|
||||||
ESP_PLATFORM_ESP32, ARDUINO_VERSION_ESP32_DEV
|
CONF_USE_CUSTOM_CODE, ESP_PLATFORM_ESP32
|
||||||
from esphomeyaml.core import ESPHomeYAMLError
|
from esphomeyaml.core import ESPHomeYAMLError
|
||||||
from esphomeyaml.core_config import VERSION_REGEX
|
from esphomeyaml.core_config import VERSION_REGEX
|
||||||
from esphomeyaml.helpers import relative_path
|
from esphomeyaml.helpers import relative_path
|
||||||
|
@ -60,8 +60,13 @@ lib_deps =
|
||||||
build_flags =
|
build_flags =
|
||||||
{build_flags}
|
{build_flags}
|
||||||
${{common.build_flags}}
|
${{common.build_flags}}
|
||||||
|
upload_speed = {upload_speed}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
UPLOAD_SPEED_OVERRIDE = {
|
||||||
|
'esp210': 57600,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def get_build_flags(config, key):
|
def get_build_flags(config, key):
|
||||||
build_flags = set()
|
build_flags = set()
|
||||||
|
@ -86,6 +91,7 @@ def get_ini_content(config, path):
|
||||||
u'platform': config[CONF_ESPHOMEYAML][CONF_ARDUINO_VERSION],
|
u'platform': config[CONF_ESPHOMEYAML][CONF_ARDUINO_VERSION],
|
||||||
u'board': config[CONF_ESPHOMEYAML][CONF_BOARD],
|
u'board': config[CONF_ESPHOMEYAML][CONF_BOARD],
|
||||||
u'build_flags': u'',
|
u'build_flags': u'',
|
||||||
|
u'upload_speed': UPLOAD_SPEED_OVERRIDE.get(core.BOARD, 115200),
|
||||||
}
|
}
|
||||||
build_flags = set()
|
build_flags = set()
|
||||||
if not config[CONF_ESPHOMEYAML][CONF_USE_CUSTOM_CODE]:
|
if not config[CONF_ESPHOMEYAML][CONF_USE_CUSTOM_CODE]:
|
||||||
|
|
Loading…
Reference in a new issue