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:
Paulus Schoutsen authored and GitHub committed 2020-03-23 12:59:36 -07:00
1 parent 2360fd4141
commit 1ff245d9c2
3 files changed
+69 -9

No files matched your search

+7 -1
View File
@@ -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)