1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-10 20:05:48 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Otto Winter
a5d0ecdb13 Bump version to v1.11.2 2019-02-26 23:04:22 +01:00
Otto Winter
71cbc9cfb0 Fix mDNS library added only with OTA (#451) 2019-02-26 23:04:20 +01:00
Otto Winter
88625c656d Remove automatic update check (#457)
* Remove automatic update check

* Lint
2019-02-26 23:04:19 +01:00
Otto Winter
971b15ac67 Allow non-pullup pins for dallas (#456) 2019-02-26 23:04:19 +01:00
Otto Winter
407c46cb03 Bump version to v1.11.1 2019-02-23 20:13:49 +01:00
6 changed files with 9 additions and 84 deletions

View File

@@ -17,8 +17,7 @@ from esphome.core import CORE, EsphomeError
from esphome.cpp_generator import Expression, RawStatement, add, statement
from esphome.helpers import color, indent
from esphome.py_compat import IS_PY2, safe_input, text_type
from esphome.storage_json import StorageJSON, esphome_storage_path, \
start_update_check_thread, storage_path
from esphome.storage_json import StorageJSON, storage_path
from esphome.util import run_external_command, run_external_process, safe_print
_LOGGER = logging.getLogger(__name__)
@@ -157,12 +156,7 @@ def write_cpp(config):
def compile_program(args, config):
_LOGGER.info("Compiling app...")
update_check = not os.getenv('ESPHOME_NO_UPDATE_CHECK', '')
if update_check:
thread = start_update_check_thread(esphome_storage_path(CORE.config_dir))
rc = platformio_api.run_compile(config, args.verbose)
if update_check:
thread.join()
return rc

View File

@@ -13,7 +13,7 @@ MULTI_CONF = True
CONFIG_SCHEMA = vol.Schema({
cv.GenerateID(): cv.declare_variable_id(DallasComponent),
vol.Required(CONF_PIN): pins.input_pullup_pin,
vol.Required(CONF_PIN): pins.input_pin,
vol.Optional(CONF_UPDATE_INTERVAL): cv.update_interval,
}).extend(cv.COMPONENT_SCHEMA.schema)

View File

@@ -51,7 +51,7 @@ REQUIRED_BUILD_FLAGS = '-DUSE_NEW_OTA'
def lib_deps(config):
if CORE.is_esp32:
return ['Update', 'ESPmDNS']
return ['Update']
if CORE.is_esp8266:
return ['Hash', 'ESP8266mDNS']
return ['Hash']
raise NotImplementedError

View File

@@ -2,10 +2,10 @@
MAJOR_VERSION = 1
MINOR_VERSION = 11
PATCH_VERSION = '0'
PATCH_VERSION = '2'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
ESPHOME_CORE_VERSION = '1.11.0'
ESPHOME_CORE_VERSION = '1.11.2'
ESP_PLATFORM_ESP32 = 'ESP32'
ESP_PLATFORM_ESP8266 = 'ESP8266'

View File

@@ -1,10 +1,9 @@
import binascii
import codecs
from datetime import datetime, timedelta
from datetime import datetime
import json
import logging
import os
import threading
from esphome import const
from esphome.core import CORE
@@ -226,72 +225,3 @@ class EsphomeStorageJSON(object):
def __eq__(self, o): # type: (Any) -> bool
return isinstance(o, EsphomeStorageJSON) and self.as_dict() == o.as_dict()
@property
def should_do_esphome_update_check(self): # type: () -> bool
if self.last_update_check is None:
return True
return self.last_update_check + timedelta(days=3) < datetime.utcnow()
class CheckForUpdateThread(threading.Thread):
def __init__(self, path):
threading.Thread.__init__(self)
self._path = path
@property
def docs_base(self):
return 'https://beta.esphome.io' if 'b' in const.__version__ else \
'https://esphome.io'
def fetch_remote_version(self):
import requests
storage = EsphomeStorageJSON.load(self._path) or \
EsphomeStorageJSON.get_default()
if not storage.should_do_esphome_update_check:
return storage
req = requests.get('{}/_static/version'.format(self.docs_base))
req.raise_for_status()
storage.remote_version = req.text.strip()
storage.last_update_check = datetime.utcnow()
storage.save(self._path)
return storage
@staticmethod
def format_version(ver):
vstr = '.'.join(map(str, ver.version))
if ver.prerelease:
vstr += ver.prerelease[0] + str(ver.prerelease[1])
return vstr
def cmp_versions(self, storage):
# pylint: disable=no-name-in-module, import-error
from distutils.version import StrictVersion
remote_version = StrictVersion(storage.remote_version)
self_version = StrictVersion(const.__version__)
if remote_version > self_version:
_LOGGER.warning("*" * 80)
_LOGGER.warning("A new version of ESPHome is available: %s (this is %s)",
self.format_version(remote_version), self.format_version(self_version))
_LOGGER.warning("Changelog: %s/changelog/index.html", self.docs_base)
_LOGGER.warning("Update Instructions: %s/guides/faq.html"
"#how-do-i-update-to-the-latest-version", self.docs_base)
_LOGGER.warning("*" * 80)
def run(self):
try:
storage = self.fetch_remote_version()
self.cmp_versions(storage)
except Exception: # pylint: disable=broad-except
pass
def start_update_check_thread(path):
# dummy call to strptime as python 2.7 has a bug with strptime when importing from threads
datetime.strptime('20180101', '%Y%m%d')
thread = CheckForUpdateThread(os.path.abspath(path))
thread.start()
return thread

View File

@@ -288,8 +288,10 @@ def gather_lib_deps():
if CORE.arduino_version in (ARDUINO_VERSION_ESP32_DEV, ARDUINO_VERSION_ESP32_1_0_1):
lib_deps.add('AsyncTCP@1.0.3')
lib_deps.discard('AsyncTCP@1.0.1')
lib_deps.add('ESPmDNS')
elif CORE.is_esp8266:
lib_deps.add('ESPAsyncTCP@1.1.3')
lib_deps.add('ESP8266mDNS')
# avoid changing build flags order
lib_deps_l = list(lib_deps)
lib_deps_l.sort()
@@ -393,7 +395,6 @@ def get_ini_content():
data['lib_ldf_mode'] = 'chain'
REMOVABLE_LIBRARIES = [
'ArduinoOTA',
'ESPmDNS',
'Update',
'Wire',
'FastLED',