Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Fix another Hue memory leak (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Mar 1, 2017
1 parent f8aeafd commit a22fb53
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions netdisco/discoverables/philips_hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def merge_entries(self, nupnp_entries, ssdp_entries):
merges them making sure that same device is only discoverd once.
"""
entries = nupnp_entries
entries = {
nupn_entry.description['URLBase']: nupn_entry
for nupn_entry in nupnp_entries
}

for nupn_entry in entries:
for ssdp_entry in ssdp_entries:
url_base1 = nupn_entry.description['URLBase']
url_base2 = ssdp_entry.description['URLBase']
for ssdp_entry in ssdp_entries:
url_base = ssdp_entry.description['URLBase']
if url_base not in entries:
entries[url_base] = ssdp_entry

if url_base1 != url_base2:
entries.append(ssdp_entry)

return entries
return list(entries.values())

0 comments on commit a22fb53

Please sign in to comment.