Simplify setup of deCONZ platforms (#72453)
This commit is contained in:
parent
fbeaf200e4
commit
e60b247b51
16 changed files with 130 additions and 134 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue