Skip to content

Commit

Permalink
fix for #197
Browse files Browse the repository at this point in the history
  • Loading branch information
Magalex2x14 committed Dec 15, 2020
1 parent 3968473 commit 4015d24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ble_monitor/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ async def async_step_init(self, user_input=None):
self._devices[idmac] = {CONF_MAC: idmac, CONF_NAME: name}

# sort devices by name
sorteddev_tuples = sorted(self._devices.items(), key=lambda item: item[1]["name"])
sorteddev_tuples = sorted(self._devices.items(), key=lambda item: item[1].get("name", item[1]["mac"]))
self._devices = dict(sorteddev_tuples)
self.hass.config_entries.async_update_entry(
self.config_entry,
Expand Down

0 comments on commit 4015d24

Please sign in to comment.