Limit upload speed to 115200 (#122)

* Limit upload speed to 115200

* Lint
This commit is contained in:
Otto Winter 2018-09-26 01:27:47 +09:00 committed by GitHub
parent 8dba37846b
commit 5e5137960d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,9 +7,9 @@ import os
from esphomeyaml import core
from esphomeyaml.config import iter_components
from esphomeyaml.const import CONF_ARDUINO_VERSION, CONF_BOARD, CONF_BOARD_FLASH_MODE, \
CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, CONF_LOCAL, CONF_NAME, CONF_USE_CUSTOM_CODE, \
ESP_PLATFORM_ESP32, ARDUINO_VERSION_ESP32_DEV
from esphomeyaml.const import ARDUINO_VERSION_ESP32_DEV, CONF_ARDUINO_VERSION, CONF_BOARD, \
CONF_BOARD_FLASH_MODE, CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, CONF_LOCAL, CONF_NAME, \
CONF_USE_CUSTOM_CODE, ESP_PLATFORM_ESP32
from esphomeyaml.core import ESPHomeYAMLError
from esphomeyaml.core_config import VERSION_REGEX
from esphomeyaml.helpers import relative_path
@ -60,8 +60,13 @@ lib_deps =
build_flags =
{build_flags}
${{common.build_flags}}
upload_speed = {upload_speed}
"""
UPLOAD_SPEED_OVERRIDE = {
'esp210': 57600,
}
def get_build_flags(config, key):
build_flags = set()
@ -86,6 +91,7 @@ def get_ini_content(config, path):
u'platform': config[CONF_ESPHOMEYAML][CONF_ARDUINO_VERSION],
u'board': config[CONF_ESPHOMEYAML][CONF_BOARD],
u'build_flags': u'',
u'upload_speed': UPLOAD_SPEED_OVERRIDE.get(core.BOARD, 115200),
}
build_flags = set()
if not config[CONF_ESPHOMEYAML][CONF_USE_CUSTOM_CODE]: