Skip to content

Commit

Permalink
Add unknown categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlusiardi committed Aug 18, 2019
1 parent 105f3e5 commit 56438db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homekit/model/categories.py
Expand Up @@ -91,6 +91,11 @@ def __getitem__(self, item):
if item in self._categories_rev:
return self._categories_rev[item]

# if we look up an integer, this may be a unknown category. So we
# a message but not an exception. See issue #131, #136 and #158.
if isinstance(item, int):
return 'Unknown Category #{c}'.format(c=item)

raise KeyError('Item {item} not found'.format(item=item))


Expand Down

0 comments on commit 56438db

Please sign in to comment.