Allow changing entity ID (#15637)

* Allow changing entity ID

* Add support to websocket command

* Address comments

* Error handling
This commit is contained in:
Paulus Schoutsen 2018-07-24 14:12:53 +02:00 committed by GitHub
parent fbeaa57604
commit d9cf8fcfe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 206 additions and 22 deletions

View file

@ -283,7 +283,7 @@ class EntityPlatform:
entity.entity_id = entry.entity_id
entity.registry_name = entry.name
entry.add_update_listener(entity)
entity.async_on_remove(entry.add_update_listener(entity))
# We won't generate an entity ID if the platform has already set one
# We will however make sure that platform cannot pick a registered ID