Make sure entity platform services work for all platforms of d… (#33176)
* Make sure entity platform services work for all platforms of domain * Register a bad service handler * Fix cleaning up * Tiny cleanup
This commit is contained in:
parent
2360fd4141
commit
1ff245d9c2
3 changed files with 69 additions and 9 deletions
|
@ -254,7 +254,13 @@ class EntityComponent:
|
|||
|
||||
This method must be run in the event loop.
|
||||
"""
|
||||
tasks = [platform.async_reset() for platform in self._platforms.values()]
|
||||
tasks = []
|
||||
|
||||
for key, platform in self._platforms.items():
|
||||
if key == self.domain:
|
||||
tasks.append(platform.async_reset())
|
||||
else:
|
||||
tasks.append(platform.async_destroy())
|
||||
|
||||
if tasks:
|
||||
await asyncio.wait(tasks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue