mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 00:48:19 +01:00
[code-quality] Apply ruff linting suggestions (#7206)
This commit is contained in:
parent
ddd8027238
commit
132269c5b8
2 changed files with 2 additions and 6 deletions
|
@ -91,7 +91,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
# pylint: disable=consider-using-f-string
|
# pylint: disable=consider-using-f-string
|
||||||
VARIABLE_PROG = re.compile(
|
VARIABLE_PROG = re.compile(
|
||||||
"\\$([{0}]+|\\{{[{0}]*\\}})".format(VALID_SUBSTITUTIONS_CHARACTERS)
|
f"\\$([{VALID_SUBSTITUTIONS_CHARACTERS}]+|\\{{[{VALID_SUBSTITUTIONS_CHARACTERS}]*\\}})"
|
||||||
)
|
)
|
||||||
|
|
||||||
# pylint: disable=invalid-name
|
# pylint: disable=invalid-name
|
||||||
|
|
|
@ -3,7 +3,6 @@ import hashlib
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
|
@ -103,10 +102,7 @@ def prepare(
|
||||||
if config[CONF_MQTT].get(CONF_SSL_FINGERPRINTS) or config[CONF_MQTT].get(
|
if config[CONF_MQTT].get(CONF_SSL_FINGERPRINTS) or config[CONF_MQTT].get(
|
||||||
CONF_CERTIFICATE_AUTHORITY
|
CONF_CERTIFICATE_AUTHORITY
|
||||||
):
|
):
|
||||||
if sys.version_info >= (2, 7, 13):
|
|
||||||
tls_version = ssl.PROTOCOL_TLS # pylint: disable=no-member
|
tls_version = ssl.PROTOCOL_TLS # pylint: disable=no-member
|
||||||
else:
|
|
||||||
tls_version = ssl.PROTOCOL_SSLv23
|
|
||||||
client.tls_set(
|
client.tls_set(
|
||||||
ca_certs=None,
|
ca_certs=None,
|
||||||
certfile=None,
|
certfile=None,
|
||||||
|
|
Loading…
Reference in a new issue