diff --git a/custom_components/panasonic_smart_app/smartApp/__init__.py b/custom_components/panasonic_smart_app/smartApp/__init__.py index aadfef4..b5b9c81 100644 --- a/custom_components/panasonic_smart_app/smartApp/__init__.py +++ b/custom_components/panasonic_smart_app/smartApp/__init__.py @@ -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) @@ -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)