Allow changing entity ID (#15637)
* Allow changing entity ID * Add support to websocket command * Address comments * Error handling
This commit is contained in:
1 parent
fbeaa57604
commit
d9cf8fcfe8
7 files changed
+206
-22
No files matched your search
@@ -400,3 +400,15 @@ def test_async_remove_no_platform(hass):
|
||||
assert len(hass.states.async_entity_ids()) == 1
|
||||
yield from ent.async_remove()
|
||||
assert len(hass.states.async_entity_ids()) == 0
|
||||
|
||||
|
||||
async def test_async_remove_runs_callbacks(hass):
|
||||
"""Test async_remove method when no platform set."""
|
||||
result = []
|
||||
|
||||
ent = entity.Entity()
|
||||
ent.hass = hass
|
||||
ent.entity_id = 'test.test'
|
||||
ent.async_on_remove(lambda: result.append(1))
|
||||
await ent.async_remove()
|
||||
assert len(result) == 1
|
||||
Reference in new issue
Block a user