mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 06:38:17 +00:00
Fix pylint errors
This commit is contained in:
parent
b8c55c5043
commit
246794c40e
@ -76,13 +76,13 @@ def run_platformio(*cmd, **kwargs):
|
||||
full_cmd = u' '.join(quote(x) for x in cmd)
|
||||
_LOGGER.info(u"Running: %s", full_cmd)
|
||||
try:
|
||||
main = kwargs.get('main')
|
||||
if main is None:
|
||||
func = kwargs.get('main')
|
||||
if func is None:
|
||||
import platformio.__main__
|
||||
main = platformio.__main__.main
|
||||
func = platformio.__main__.main
|
||||
sys.argv = list(cmd)
|
||||
sys.exit = mock_exit
|
||||
return main() or 0
|
||||
return func() or 0
|
||||
except KeyboardInterrupt:
|
||||
return 1
|
||||
except SystemExit as err:
|
||||
@ -177,6 +177,7 @@ def upload_using_esptool(config, port):
|
||||
|
||||
name = get_name(config)
|
||||
path = os.path.join(get_base_path(config), '.pioenvs', name, 'firmware.bin')
|
||||
# pylint: disable=protected-access
|
||||
return run_platformio('esptool.py', '--before', 'default_reset', '--after', 'hard_reset',
|
||||
'--chip', 'esp8266', '--port', port, 'write_flash', '0x0',
|
||||
path, main=esptool._main)
|
||||
|
@ -26,7 +26,7 @@ from esphomeyaml.helpers import quote
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
CONFIG_DIR = ''
|
||||
|
||||
|
||||
# pylint: disable=abstract-method, arguments-differ
|
||||
class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
|
||||
def __init__(self, application, request, **kwargs):
|
||||
super(EsphomeyamlCommandWebSocket, self).__init__(application, request, **kwargs)
|
||||
@ -72,9 +72,6 @@ class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
|
||||
|
||||
|
||||
class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket):
|
||||
def __init__(self, application, request, **kwargs):
|
||||
super(EsphomeyamlLogsHandler, self).__init__(application, request, **kwargs)
|
||||
|
||||
def build_command(self, message):
|
||||
js = json.loads(message)
|
||||
config_file = CONFIG_DIR + '/' + js['configuration']
|
||||
@ -82,9 +79,6 @@ class EsphomeyamlLogsHandler(EsphomeyamlCommandWebSocket):
|
||||
|
||||
|
||||
class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket):
|
||||
def __init__(self, application, request, **kwargs):
|
||||
super(EsphomeyamlRunHandler, self).__init__(application, request, **kwargs)
|
||||
|
||||
def build_command(self, message):
|
||||
js = json.loads(message)
|
||||
config_file = os.path.join(CONFIG_DIR, js['configuration'])
|
||||
@ -93,9 +87,6 @@ class EsphomeyamlRunHandler(EsphomeyamlCommandWebSocket):
|
||||
|
||||
|
||||
class EsphomeyamlCompileHandler(EsphomeyamlCommandWebSocket):
|
||||
def __init__(self, application, request, **kwargs):
|
||||
super(EsphomeyamlCompileHandler, self).__init__(application, request, **kwargs)
|
||||
|
||||
def build_command(self, message):
|
||||
js = json.loads(message)
|
||||
config_file = os.path.join(CONFIG_DIR, js['configuration'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user