Refactor ZHA device initialized logic (#25796)
* refactor device initialized * better names and update tests * clean up last seen logic * logging consistency
This commit is contained in:
parent
dc5c1783dc
commit
fafd228418
3 changed files with 97 additions and 52 deletions
|
@ -140,7 +140,10 @@ async def async_init_zigpy_device(
|
|||
device = make_device(
|
||||
in_cluster_ids, out_cluster_ids, device_type, ieee, manufacturer, model
|
||||
)
|
||||
await gateway.async_device_initialized(device, is_new_join)
|
||||
if is_new_join:
|
||||
await gateway.async_device_initialized(device)
|
||||
else:
|
||||
await gateway.async_device_restored(device)
|
||||
await hass.async_block_till_done()
|
||||
return device
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue