Bootstrap / Component setup async (#6264)

* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
This commit is contained in:
Pascal Vizeli 2017-03-01 05:33:19 +01:00 committed by Paulus Schoutsen
parent 383b0914b3
commit 41f558b181
109 changed files with 764 additions and 848 deletions

View file

@ -63,11 +63,12 @@ class TestComponentZone(unittest.TestCase):
},
]
})
self.hass.block_till_done()
active = zone.active_zone(self.hass, 32.880600, -117.237561)
assert active is None
self.hass.config.components.remove('zone')
def test_active_zone_skips_passive_zones_2(self):
"""Test active and passive zones."""
assert bootstrap.setup_component(self.hass, zone.DOMAIN, {
'zone': [
{
@ -78,7 +79,7 @@ class TestComponentZone(unittest.TestCase):
},
]
})
self.hass.block_till_done()
active = zone.active_zone(self.hass, 32.880700, -117.237561)
assert 'zone.active_zone' == active.entity_id
@ -106,7 +107,10 @@ class TestComponentZone(unittest.TestCase):
active = zone.active_zone(self.hass, latitude, longitude)
assert 'zone.small_zone' == active.entity_id
self.hass.config.components.remove('zone')
def test_active_zone_prefers_smaller_zone_if_same_distance_2(self):
"""Test zone size preferences."""
latitude = 32.880600
longitude = -117.237561
assert bootstrap.setup_component(self.hass, zone.DOMAIN, {
'zone': [
{