Clean up entity component (#11691)

* Clean up entity component

* Lint

* List -> Tuple

* Add Entity.async_remove back

* Unflake setting up group test
This commit is contained in:
Paulus Schoutsen 2018-01-22 22:54:41 -08:00 committed by GitHub
parent d478517c51
commit 183e0543b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 230 additions and 191 deletions

View file

@ -388,3 +388,15 @@ def test_async_pararell_updates_with_two(hass):
test_lock.release()
yield from asyncio.sleep(0, loop=hass.loop)
test_lock.release()
@asyncio.coroutine
def test_async_remove_no_platform(hass):
"""Test async_remove method when no platform set."""
ent = entity.Entity()
ent.hass = hass
ent.entity_id = 'test.test'
yield from ent.async_update_ha_state()
assert len(hass.states.async_entity_ids()) == 1
yield from ent.async_remove()
assert len(hass.states.async_entity_ids()) == 0