mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 02:28:28 +02:00
Bump pylint from 2.5.3 to 2.6.0 (#1262)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
@@ -104,6 +104,7 @@ def parse_multi_click_timing_str(value):
|
||||
try:
|
||||
state = cv.boolean(parts[0])
|
||||
except cv.Invalid:
|
||||
# pylint: disable=raise-missing-from
|
||||
raise cv.Invalid("First word must either be ON or OFF, not {}".format(parts[0]))
|
||||
|
||||
if parts[1] != 'for':
|
||||
|
||||
@@ -42,9 +42,9 @@ def validate_glyphs(value):
|
||||
def validate_pillow_installed(value):
|
||||
try:
|
||||
import PIL
|
||||
except ImportError:
|
||||
except ImportError as err:
|
||||
raise cv.Invalid("Please install the pillow python package to use this feature. "
|
||||
"(pip install pillow)")
|
||||
"(pip install pillow)") from err
|
||||
|
||||
if PIL.__version__[0] < '4':
|
||||
raise cv.Invalid("Please update your pillow installation to at least 4.0.x. "
|
||||
|
||||
@@ -43,8 +43,8 @@ def validate_url(value):
|
||||
value = cv.string(value)
|
||||
try:
|
||||
parsed = list(urlparse.urlparse(value))
|
||||
except Exception:
|
||||
raise cv.Invalid('Invalid URL')
|
||||
except Exception as err:
|
||||
raise cv.Invalid('Invalid URL') from err
|
||||
|
||||
if not parsed[0] or not parsed[1]:
|
||||
raise cv.Invalid('URL must have a URL scheme and host')
|
||||
|
||||
@@ -18,8 +18,8 @@ def validate_uid(value):
|
||||
"long.")
|
||||
try:
|
||||
x = int(x, 16)
|
||||
except ValueError:
|
||||
raise cv.Invalid("Valid characters for parts of a UID are 0123456789ABCDEF.")
|
||||
except ValueError as err:
|
||||
raise cv.Invalid("Valid characters for parts of a UID are 0123456789ABCDEF.") from err
|
||||
if x < 0 or x > 255:
|
||||
raise cv.Invalid("Valid values for UID parts (separated by '-') are 00 to FF")
|
||||
return value
|
||||
|
||||
@@ -28,6 +28,7 @@ def validate_acceleration(value):
|
||||
try:
|
||||
value = float(value)
|
||||
except ValueError:
|
||||
# pylint: disable=raise-missing-from
|
||||
raise cv.Invalid(f"Expected acceleration as floating point number, got {value}")
|
||||
|
||||
if value <= 0:
|
||||
@@ -48,6 +49,7 @@ def validate_speed(value):
|
||||
try:
|
||||
value = float(value)
|
||||
except ValueError:
|
||||
# pylint: disable=raise-missing-from
|
||||
raise cv.Invalid(f"Expected speed as floating point number, got {value}")
|
||||
|
||||
if value <= 0:
|
||||
|
||||
@@ -138,6 +138,7 @@ def _parse_cron_int(value, special_mapping, message):
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
# pylint: disable=raise-missing-from
|
||||
raise cv.Invalid(message.format(value))
|
||||
|
||||
|
||||
@@ -158,6 +159,7 @@ def _parse_cron_part(part, min_value, max_value, special_mapping):
|
||||
try:
|
||||
repeat_n = int(repeat)
|
||||
except ValueError:
|
||||
# pylint: disable=raise-missing-from
|
||||
raise cv.Invalid("Repeat for '/' time expression must be an integer, got {}"
|
||||
.format(repeat))
|
||||
return set(range(offset_n, max_value + 1, repeat_n))
|
||||
|
||||
@@ -18,9 +18,9 @@ _LOGGER = logging.getLogger(__name__)
|
||||
def validate_cryptography_installed():
|
||||
try:
|
||||
import cryptography
|
||||
except ImportError:
|
||||
except ImportError as err:
|
||||
raise cv.Invalid("This settings requires the cryptography python package. "
|
||||
"Please install it with `pip install cryptography`")
|
||||
"Please install it with `pip install cryptography`") from err
|
||||
|
||||
if cryptography.__version__[0] < '2':
|
||||
raise cv.Invalid("Please update your python cryptography installation to least 2.x "
|
||||
|
||||
Reference in New Issue
Block a user