Skip to content

Commit

Permalink
Merge pull request #87 from kvj/fix_ring_suppr
Browse files Browse the repository at this point in the history
Suppress Web API call exception, to continue entry setup
  • Loading branch information
kvj authored Aug 26, 2022
2 parents 1c22f02 + c07f8b8 commit eda3336
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion custom_components/nuki_ng/nuki.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,28 @@ async def _update(self):
bridge_info["callbacks_list"] = callbacks_list
device_list = await self.api.bridge_list()
if self.api.can_web():
web_list = await self.api.web_list()
try:
web_list = await self.api.web_list()
except ConnectionError:
_LOGGER.warning("Despite being configured, Web API request has failed")
_LOGGER.exception("Error while fetching list of devices via web API:")
if not device_list:
device_list = web_list
result = dict(devices={}, bridge_info=bridge_info)
if not device_list:
raise ConnectionError("No available device data")
for key, item in device_list.items():
dev_id = item["nukiId"]
if self.api.can_web():
try:
item["web_auth"] = await self.api.web_list_all_auths(dev_id)
except ConnectionError:
_LOGGER.warning("Despite being configured, Web API request has failed")
_LOGGER.exception("Error while fetching auth:")
try:
item["last_log"] = await self.api.web_get_last_unlock_log(dev_id)
except ConnectionError:
_LOGGER.warning("Despite being configured, Web API request has failed")
_LOGGER.exception("Error while fetching last log entry")
if web_list:
item["config"] = web_list.get(dev_id, {}).get("config")
Expand Down

0 comments on commit eda3336

Please sign in to comment.