deCONZ fix comments from #40265 (#40640)

* Use set not list

* Events are not entities

* Don't await unload_events

* Remove checks of entities content in tests

* List to set comprehension

* Why is it so hard to remember that sets arent parenthesis...
This commit is contained in:
Robert Svensson 2020-09-27 11:02:45 +02:00 committed by GitHub
parent 8895752837
commit 66a8edb11e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 20 additions and 67 deletions

View file

@ -96,7 +96,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if sensor.battery is not None:
battery_handler.remove_tracker(sensor)
known_batteries = list(gateway.entities[DOMAIN])
known_batteries = set(gateway.entities[DOMAIN])
new_battery = DeconzBattery(sensor, gateway)
if new_battery.unique_id not in known_batteries:
entities.append(new_battery)