From 795dd716c916425c7b9ca9303e84a28ccf0e465e Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 25 Nov 2018 20:21:51 +0100 Subject: [PATCH] Lint --- .gitignore | 1 + esphomeyaml/core_config.py | 6 +++--- esphomeyaml/wizard.py | 13 +------------ tests/test1.yaml | 3 ++- tests/test2.yaml | 3 ++- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 9de7ba163d..d871a420e0 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ venv.bak/ config/ tests/build/ +tests/.esphomeyaml/ diff --git a/esphomeyaml/core_config.py b/esphomeyaml/core_config.py index 6b815fbab9..757e4315a0 100644 --- a/esphomeyaml/core_config.py +++ b/esphomeyaml/core_config.py @@ -1,4 +1,3 @@ -import codecs import logging import os import re @@ -233,6 +232,7 @@ def lib_deps(config): def includes(config): ret = [] for include in config.get(CONF_INCLUDES, []): - with codecs.open(CORE.relative_path(include), 'r', encoding='utf-8') as f_handle: - ret.append(f_handle.read()) + path = CORE.relative_path(include) + res = os.path.relpath(path, CORE.relative_build_path('src', 'main.cpp')) + ret.append(res) return ret diff --git a/esphomeyaml/wizard.py b/esphomeyaml/wizard.py index 0cb7653059..b20db2a663 100644 --- a/esphomeyaml/wizard.py +++ b/esphomeyaml/wizard.py @@ -6,7 +6,6 @@ import unicodedata import voluptuous as vol -from esphomeyaml.components import mqtt import esphomeyaml.config_validation as cv from esphomeyaml.const import ESP_PLATFORMS, ESP_PLATFORM_ESP32, ESP_PLATFORM_ESP8266 from esphomeyaml.helpers import color @@ -264,17 +263,7 @@ def wizard(path): safe_print("Please enter the " + color('green', 'address') + " of your MQTT broker.") safe_print() safe_print("For example \"{}\".".format(color('bold_white', '192.168.178.84'))) - while True: - broker = raw_input(color('bold_white', "(broker): ")) - try: - broker = mqtt.validate_broker(broker) - break - except vol.Invalid as err: - safe_print(color('red', u"The broker address \"{}\" seems to be invalid: {} :(" - u"".format(broker, err))) - safe_print("Please try again.") - safe_print() - sleep(1) + broker = raw_input(color('bold_white', "(broker): ")) safe_print("Thanks! Now enter the " + color('green', 'username') + " and " + color('green', 'password') + diff --git a/tests/test1.yaml b/tests/test1.yaml index d1eabb16b9..e05d2892e4 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -3,7 +3,8 @@ esphomeyaml: platform: ESP32 board: nodemcu-32s # Use latest upstream esphomelib git version. - esphomelib_version: dev + esphomelib_version: + branch: custom-sensor-platform # Use this for testing while developing: # esphomelib_version: # local: ~/path/to/esphomelib diff --git a/tests/test2.yaml b/tests/test2.yaml index 20983e0b01..1e1e3195d7 100644 --- a/tests/test2.yaml +++ b/tests/test2.yaml @@ -3,7 +3,8 @@ esphomeyaml: platform: ESP32 board: nodemcu-32s # Use latest upstream esphomelib git version. - esphomelib_version: dev + esphomelib_version: + branch: custom-sensor-platform # Use this for testing while developing: # esphomelib_version: # local: ~/path/to/esphomelib