Skip to content

Commit

Permalink
Declare Variable Before Using It
Browse files Browse the repository at this point in the history
  • Loading branch information
krkeegan committed Nov 14, 2024
1 parent 12e1dd5 commit a1168e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion insteon_mqtt/cmd_line/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def send(config, topic, payload, quiet=False):
encryption = config["mqtt"].get('encryption', {})
if encryption is None:
encryption = {}
addl_tls_kwargs = {}
ca_cert = encryption.get('ca_cert', None)
enable_tls = encryption.get('enable', None)
if (ca_cert is not None and ca_cert != "") or enable_tls:
Expand All @@ -103,7 +104,6 @@ def send(config, topic, payload, quiet=False):

# These require passing specific constants so we use a lookup
# map for them.
addl_tls_kwargs = {}
tls_ver = encryption.get('tls_version', 'tls')
tls_version_const = TLS_VER_OPTIONS.get(tls_ver, None)
if tls_version_const is not None:
Expand Down
2 changes: 1 addition & 1 deletion insteon_mqtt/network/Mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def load_config(self, config):
encryption = config.get('encryption', {})
if encryption is None:
encryption = {}
addl_tls_kwargs = {}
ca_cert = encryption.get('ca_cert', None)
enable_tls = encryption.get('enable', None)
if (ca_cert is not None and ca_cert != "") or enable_tls:
Expand All @@ -174,7 +175,6 @@ def load_config(self, config):

# These require passing specific constants so we use a lookup
# map for them.
addl_tls_kwargs = {}
tls_ver = encryption.get('tls_version', 'tls')
tls_version_const = self.TLS_VER_OPTIONS.get(tls_ver, None)
if tls_version_const is not None:
Expand Down

0 comments on commit a1168e8

Please sign in to comment.