Skip to content

Commit 52aed6a

Browse files
authored
Merge pull request #12 from rospogrigio/fix_local_variable_res
Fixing UnboundLocalError: local variable 'res' referenced before assignment
2 parents 06db29c + 388dc74 commit 52aed6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

custom_components/daikin_residential/daikin_api.py

+3
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,15 @@ async def refreshAccessToken(self):
132132
"AuthFlow": "REFRESH_TOKEN_AUTH",
133133
"AuthParameters": {"REFRESH_TOKEN": self.tokenSet["refresh_token"]},
134134
}
135+
135136
try:
136137
func = functools.partial(requests.post, url, headers=headers, json=ref_json)
137138
res = await self.hass.async_add_executor_job(func)
138139
# res = requests.post(url, headers=headers, json=ref_json)
139140
except Exception as e:
140141
_LOGGER.error("REQUEST FAILED: %s", e)
142+
raise e
143+
141144
_LOGGER.debug("refreshAccessToken response code: %s", res.status_code)
142145
_LOGGER.debug("refreshAccessToken response: %s", res.json())
143146
res_json = res.json()

0 commit comments

Comments
 (0)