Skip to content

Commit

Permalink
Remove items that are removed from hue (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored and balloob committed Sep 25, 2019
1 parent c027063 commit d3dd8d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aiohue/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def _process_raw(self, raw):
obj.raw = raw_item
else:
self._items[id] = self._item_cls(id, raw_item, self._request)

removed_items = []

for id in self._items:
if id not in raw:
removed_items.append(id)

for id in removed_items:
del self._items[id]

def values(self):
return self._items.values()
Expand Down

0 comments on commit d3dd8d9

Please sign in to comment.