Skip to content

Commit

Permalink
security fix
Browse files Browse the repository at this point in the history
  • Loading branch information
georgezhao2010 committed Sep 30, 2023
1 parent 3f87212 commit 392e566
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/midea_ac_lan/midea/core/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def _api_request(self, endpoint: str, data: dict, header=None) -> dict | N
response = json.loads(raw)
break
except Exception as e:
pass
_LOGGER.warning(f"Midea cloud API error, url: {url}, error: {repr(e)}")
if int(response["code"]) == 0 and "data" in response:
return response["data"]
return None
Expand Down Expand Up @@ -576,8 +576,8 @@ async def _api_request(self, endpoint: str, data: dict, header=None) -> dict | N
_LOGGER.debug(f"Midea cloud API url: {url}, data: {data}, response: {raw}")
response = json.loads(raw)
break
except Exception:
pass
except Exception as e:
_LOGGER.warning(f"Midea cloud API error, url: {url}, error: {repr(e)}")
if int(response["errorCode"]) == 0 and "result" in response:
return response["result"]
return None
Expand Down

0 comments on commit 392e566

Please sign in to comment.