diff --git a/esphome/const.py b/esphome/const.py index a683ec4176..24a3573fea 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -573,6 +573,9 @@ CONF_WIND_SPEED = 'wind_speed' CONF_WINDOW_SIZE = 'window_size' CONF_ZERO = 'zero' +ENV_NOGITIGNORE = 'ESPHOME_NOGITIGNORE' +ENV_QUICKWIZARD = 'ESPHOME_QUICKWIZARD' + ICON_ACCELERATION = 'mdi:axis-arrow' ICON_ACCELERATION_X = 'mdi:axis-x-arrow' ICON_ACCELERATION_Y = 'mdi:axis-y-arrow' diff --git a/esphome/wizard.py b/esphome/wizard.py index 3ec6c9fd10..9b6237acf3 100644 --- a/esphome/wizard.py +++ b/esphome/wizard.py @@ -11,7 +11,7 @@ from esphome.helpers import color, get_bool_env, write_file from esphome.pins import ESP32_BOARD_PINS, ESP8266_BOARD_PINS from esphome.storage_json import StorageJSON, ext_storage_path from esphome.util import safe_print -from esphome.const import ALLOWED_NAME_CHARS +from esphome.const import ALLOWED_NAME_CHARS, ENV_QUICKWIZARD CORE_BIG = r""" _____ ____ _____ ______ / ____/ __ \| __ \| ____| @@ -107,7 +107,7 @@ def wizard_write(path, **kwargs): storage.save(storage_path) -if get_bool_env('ESPHOME_QUICKWIZARD'): +if get_bool_env(ENV_QUICKWIZARD): def sleep(time): pass else: diff --git a/esphome/writer.py b/esphome/writer.py index faf086519b..237f0fb4b7 100644 --- a/esphome/writer.py +++ b/esphome/writer.py @@ -4,10 +4,11 @@ import re from esphome.config import iter_components from esphome.const import CONF_BOARD_FLASH_MODE, CONF_ESPHOME, CONF_PLATFORMIO_OPTIONS, \ - HEADER_FILE_EXTENSIONS, SOURCE_FILE_EXTENSIONS, __version__, ARDUINO_VERSION_ESP8266 + HEADER_FILE_EXTENSIONS, SOURCE_FILE_EXTENSIONS, __version__, ARDUINO_VERSION_ESP8266, \ + ENV_NOGITIGNORE from esphome.core import CORE, EsphomeError from esphome.helpers import mkdir_p, read_file, write_file_if_changed, walk_files, \ - copy_file_if_changed + copy_file_if_changed, get_bool_env from esphome.storage_json import StorageJSON, storage_path from esphome.pins import ESP8266_FLASH_SIZES, ESP8266_LD_SCRIPTS @@ -284,7 +285,8 @@ def write_platformio_project(): mkdir_p(CORE.build_path) content = get_ini_content() - write_gitignore() + if not get_bool_env(ENV_NOGITIGNORE): + write_gitignore() write_platformio_ini(content)