From 09ed1d9f867ac0845ebd4d2530316992dcb76c84 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 3 Jun 2019 14:43:35 +0200 Subject: [PATCH] Updates --- esphome/api/client.py | 4 ++-- esphome/components/mqtt/mqtt_client.cpp | 4 ++-- script/lint-python | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/esphome/api/client.py b/esphome/api/client.py index 35d9554ad9..cdafcc1d74 100644 --- a/esphome/api/client.py +++ b/esphome/api/client.py @@ -446,8 +446,8 @@ def run_logs(config, address): try: cli.connect() cli.login() - except APIConnectionError as err: # noqa - error = err + except APIConnectionError as err2: # noqa + error = err2 if error is None: _LOGGER.info("Successfully connected to %s", address) diff --git a/esphome/components/mqtt/mqtt_client.cpp b/esphome/components/mqtt/mqtt_client.cpp index 68162f33f0..e07204d559 100644 --- a/esphome/components/mqtt/mqtt_client.cpp +++ b/esphome/components/mqtt/mqtt_client.cpp @@ -371,8 +371,8 @@ bool MQTTClientComponent::publish(const std::string &topic, const char *payload, if (ret != 0) { ESP_LOGV(TAG, "Publish(topic='%s' payload='%s' retain=%d)", topic.c_str(), payload, retain); } else { - ESP_LOGV(TAG, "Publish failed for topic='%s' (len=%u). will retry later..", - topic.c_str(), payload_length); + ESP_LOGV(TAG, "Publish failed for topic='%s' (len=%u). will retry later..", topic.c_str(), + payload_length); // NOLINT this->status_momentary_warning("publish", 1000); } } diff --git a/script/lint-python b/script/lint-python index 7e3edb4d58..3fbc329ab0 100755 --- a/script/lint-python +++ b/script/lint-python @@ -56,7 +56,7 @@ def main(): print("Running flake8...") log = get_output(*cmd) for line in log.splitlines(): - line = line.split(':') + line = line.split(':', 4) if len(line) < 4: continue file_ = line[0] @@ -69,12 +69,12 @@ def main(): print("Running pylint...") log = get_output(*cmd) for line in log.splitlines(): - line = line.split(':') + line = line.split(':', 3) if len(line) < 3: continue file_ = line[0] linno = line[1] - msg = (u':'.join(line[3:])).strip() + msg = (u':'.join(line[2:])).strip() print_error(file_, linno, msg) errors += 1