* 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:
parent
8895752837
commit
66a8edb11e
12 changed files with 20 additions and 67 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue