Skip to content

Commit

Permalink
Fixed error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rospogrigio authored Dec 10, 2021
1 parent 22372a5 commit 6eaa6b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/airbnk_mqtt/airbnk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,16 @@ async def getVoltageCfg(hass, userId, token, lock_model, hw_version):
func = functools.partial(requests.get, url, headers=AIRBNK_HEADERS)
res = await hass.async_add_executor_job(func)
except Exception as e:
_LOGGER.error("GCD CALL FAILED: %s", e)
_LOGGER.error("GVC CALL FAILED: %s", e)
return None

if res.status_code != 200:
_LOGGER.error("GCD failed (%s): %s", res.status_code, res.text)
_LOGGER.error("GVC failed (%s): %s", res.status_code, res.text)
return None

json_data = res.json()
if json_data["code"] != 200:
_LOGGER.error("GCD failed2 (%s): %s", json_data["code"], res.text)
_LOGGER.error("GVC failed2 (%s): %s", json_data["code"], res.text)
return None

_LOGGER.debug("getVoltageCfg succeeded (%s)", res.status_code)
Expand Down

0 comments on commit 6eaa6b2

Please sign in to comment.