Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Apr 24, 2022
1 parent f55951e commit 968ae43
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devicesnamesconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def is_devices_file_empty(self) -> bool:

def get_friendly_name(self, short_address_value) -> str:
"""Retrieve friendly_name."""
return self._devices_names[short_address_value].get(
"friendly_name", f"{short_address_value}"
)
if short_address_value in self._devices_names:
return self._devices_names[short_address_value].get(
"friendly_name", f"{short_address_value}"
)
return str(short_address_value)

0 comments on commit 968ae43

Please sign in to comment.