Skip to content

Commit

Permalink
Merge pull request #85 from kvj/fix_ring_suppr
Browse files Browse the repository at this point in the history
Fix device enumeration during discovery
  • Loading branch information
kvj authored Aug 26, 2022
2 parents de64ecf + 53ca8a0 commit 1c22f02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/nuki_ng/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ async def find_nuki_devices(self, config: dict):
use_hashed_token = info.get("bridgeType") == 1
response = await nuki.bridge_list()
_LOGGER.debug(f"bridge devices: {response}")
title = response[0]["name"]
first_device = next(iter(response.values()), {})
title = first_device.get("name")
if not title:
return title, "invalid_bridge_token", None
except Exception as err:
_LOGGER.exception(
f"Failed to get list of devices from bridge: {err}")
Expand Down

0 comments on commit 1c22f02

Please sign in to comment.