Remove state when entity is removed from registry (#32184)

This commit is contained in:
Erik Montnemery authored and GitHub committed 2020-03-26 16:33:50 -07:00
1 parent a6d5ed0160
commit 867630a4a7
1 file changed
+1
+1
View File
@@ -542,6 +542,7 @@ class Entity(ABC):
data = event.data
if data["action"] == "remove" and data["entity_id"] == self.entity_id:
await self.async_removed_from_registry()
await self.async_remove()
if (
data["action"] != "update"