Skip to content

Commit

Permalink
Improve exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
osk2 committed Aug 19, 2021
1 parent 2dc2bda commit 93c0998
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/panasonic_smart_app/smartApp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async def request(
timeout=REQUEST_TIMEOUT,
)
except:
auth = headers["auth"] or None
auth = headers.get("auth")
if auth:
device = list(
filter(lambda device: device["auth"] == auth, self._devices)
Expand All @@ -246,7 +246,7 @@ async def request(
resp = await response.json()

if resp.get("StateMsg") == EXCEPTION_COMMAND_NOT_FOUND:
auth = headers["auth"]
auth = headers.get("auth")
if auth:
device = list(
filter(lambda device: device["auth"] == auth, self._devices)
Expand Down

0 comments on commit 93c0998

Please sign in to comment.