Simplify setup of deCONZ platforms (#72453)

This commit is contained in:
Robert Svensson 2022-05-25 05:48:09 +02:00 committed by GitHub
parent fbeaf200e4
commit e60b247b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 130 additions and 134 deletions

View file

@ -207,14 +207,10 @@ async def async_setup_entry(
async_add_entities([DeconzBinarySensor(sensor, gateway, description)])
config_entry.async_on_unload(
gateway.api.sensors.subscribe(
gateway.evaluate_add_device(async_add_sensor),
EventType.ADDED,
)
gateway.register_platform_add_device_callback(
async_add_sensor,
gateway.api.sensors,
)
for sensor_id in gateway.api.sensors:
async_add_sensor(EventType.ADDED, sensor_id)
@callback
def async_reload_clip_sensors() -> None: