1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

New coroutine-based task execution

This commit is contained in:
Otto Winter
2018-06-02 22:22:20 +02:00
parent 2db45898e2
commit 6e85a741ae
76 changed files with 1145 additions and 678 deletions

View File

@@ -8,7 +8,10 @@ import os
import random
import subprocess
_LOGGER = logging.getLogger(__name__)
from esphomeyaml.core import ESPHomeYAMLError
from esphomeyaml import const, core, __main__
from esphomeyaml.__main__ import get_serial_ports, get_base_path, get_name
from esphomeyaml.helpers import quote
try:
import tornado
@@ -20,13 +23,9 @@ try:
import tornado.websocket
import tornado.concurrent
except ImportError as err:
_LOGGER.error("Attempted to load dashboard, but tornado is not installed! "
"Please run \"pip2 install tornado esptool\" in your terminal.")
from esphomeyaml import const, core, __main__
from esphomeyaml.__main__ import get_serial_ports, get_base_path, get_name
from esphomeyaml.helpers import quote
tornado = None
_LOGGER = logging.getLogger(__name__)
CONFIG_DIR = ''
@@ -167,6 +166,11 @@ def make_app():
def start_web_server(args):
global CONFIG_DIR
if tornado is None:
raise ESPHomeYAMLError("Attempted to load dashboard, but tornado is not installed! "
"Please run \"pip2 install tornado esptool\" in your terminal.")
CONFIG_DIR = args.configuration
if not os.path.exists(CONFIG_DIR):
os.makedirs(CONFIG_DIR)