mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Download Efficiency
This commit is contained in:
		| @@ -11,6 +11,8 @@ stages: | |||||||
|  |  | ||||||
| .lint: &lint | .lint: &lint | ||||||
|   stage: lint |   stage: lint | ||||||
|  |   before_script: | ||||||
|  |     - pip install -e . | ||||||
|   tags: |   tags: | ||||||
|     - python2.7 |     - python2.7 | ||||||
|     - esphomeyaml-lint |     - esphomeyaml-lint | ||||||
|   | |||||||
| @@ -19,6 +19,7 @@ from esphomeyaml.cpp_types import App, NoArg, const_char_ptr, esphomelib_ns | |||||||
| _LOGGER = logging.getLogger(__name__) | _LOGGER = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| LIBRARY_URI_REPO = u'https://github.com/OttoWinter/esphomelib.git' | LIBRARY_URI_REPO = u'https://github.com/OttoWinter/esphomelib.git' | ||||||
|  | GITHUB_ARCHIVE_ZIP = u'https://github.com/OttoWinter/esphomelib/archive/{}.zip' | ||||||
|  |  | ||||||
| BUILD_FLASH_MODES = ['qio', 'qout', 'dio', 'dout'] | BUILD_FLASH_MODES = ['qio', 'qout', 'dio', 'dout'] | ||||||
| StartupTrigger = esphomelib_ns.StartupTrigger | StartupTrigger = esphomelib_ns.StartupTrigger | ||||||
|   | |||||||
| @@ -86,7 +86,7 @@ def wizard_write(path, **kwargs): | |||||||
|     name = kwargs['name'] |     name = kwargs['name'] | ||||||
|     board = kwargs['board'] |     board = kwargs['board'] | ||||||
|     if 'platform' not in kwargs: |     if 'platform' not in kwargs: | ||||||
|         kwargs['platform'] = 'ESP8266' if board in ESP32_BOARD_PINS else 'ESP32' |         kwargs['platform'] = 'ESP8266' if board in ESP8266_BOARD_PINS else 'ESP32' | ||||||
|     platform = kwargs['platform'] |     platform = kwargs['platform'] | ||||||
|  |  | ||||||
|     with codecs.open(path, 'w') as f_handle: |     with codecs.open(path, 'w') as f_handle: | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ from esphomeyaml.const import ARDUINO_VERSION_ESP32_DEV, CONF_ARDUINO_VERSION, \ | |||||||
|     CONF_BOARD_FLASH_MODE, CONF_BRANCH, CONF_COMMIT, CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, \ |     CONF_BOARD_FLASH_MODE, CONF_BRANCH, CONF_COMMIT, CONF_ESPHOMELIB_VERSION, CONF_ESPHOMEYAML, \ | ||||||
|     CONF_LOCAL, CONF_REPOSITORY, CONF_TAG, CONF_USE_CUSTOM_CODE |     CONF_LOCAL, CONF_REPOSITORY, CONF_TAG, CONF_USE_CUSTOM_CODE | ||||||
| from esphomeyaml.core import CORE, EsphomeyamlError | from esphomeyaml.core import CORE, EsphomeyamlError | ||||||
| from esphomeyaml.core_config import VERSION_REGEX | from esphomeyaml.core_config import VERSION_REGEX, LIBRARY_URI_REPO, GITHUB_ARCHIVE_ZIP | ||||||
| from esphomeyaml.helpers import mkdir_p, run_system_command | from esphomeyaml.helpers import mkdir_p, run_system_command | ||||||
| from esphomeyaml.storage_json import StorageJSON, storage_path | from esphomeyaml.storage_json import StorageJSON, storage_path | ||||||
| from esphomeyaml.util import safe_print | from esphomeyaml.util import safe_print | ||||||
| @@ -222,11 +222,13 @@ def gather_lib_deps(): | |||||||
|     lib_deps = set() |     lib_deps = set() | ||||||
|     esphomelib_version = CORE.config[CONF_ESPHOMEYAML][CONF_ESPHOMELIB_VERSION] |     esphomelib_version = CORE.config[CONF_ESPHOMEYAML][CONF_ESPHOMELIB_VERSION] | ||||||
|     if CONF_REPOSITORY in esphomelib_version: |     if CONF_REPOSITORY in esphomelib_version: | ||||||
|  |         repo = esphomelib_version[CONF_REPOSITORY] | ||||||
|         ref = next((esphomelib_version[x] for x in (CONF_COMMIT, CONF_BRANCH, CONF_TAG) |         ref = next((esphomelib_version[x] for x in (CONF_COMMIT, CONF_BRANCH, CONF_TAG) | ||||||
|                     if x in esphomelib_version), None) |                     if x in esphomelib_version), None) | ||||||
|         this_version = esphomelib_version[CONF_REPOSITORY] |         if CONF_TAG in esphomelib_version and repo == LIBRARY_URI_REPO: | ||||||
|         if ref is not None: |             this_version = GITHUB_ARCHIVE_ZIP.format(ref) | ||||||
|             this_version += '#' + ref |         elif ref is not None: | ||||||
|  |             this_version = repo + '#' + ref | ||||||
|         lib_deps.add(this_version) |         lib_deps.add(this_version) | ||||||
|     elif CORE.is_local_esphomelib_copy: |     elif CORE.is_local_esphomelib_copy: | ||||||
|         src_path = CORE.relative_path(esphomelib_version[CONF_LOCAL]) |         src_path = CORE.relative_path(esphomelib_version[CONF_LOCAL]) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user