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

@ -100,7 +100,6 @@ class TestLightMQTT(unittest.TestCase):
def test_fail_setup_if_no_command_topic(self):
"""Test if command fails with command topic."""
self.hass.config.components = set(['mqtt'])
with assert_setup_component(0):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
@ -113,7 +112,6 @@ class TestLightMQTT(unittest.TestCase):
def test_no_color_or_brightness_or_color_temp_if_no_topics(self): \
# pylint: disable=invalid-name
"""Test if there is no color and brightness if no topic."""
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
@ -158,7 +156,6 @@ class TestLightMQTT(unittest.TestCase):
'payload_off': 0
}}
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, config)
@ -214,7 +211,6 @@ class TestLightMQTT(unittest.TestCase):
def test_controlling_scale(self):
"""Test the controlling scale."""
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
@ -277,7 +273,6 @@ class TestLightMQTT(unittest.TestCase):
'rgb_value_template': '{{ value_json.hello | join(",") }}',
}}
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, config)
@ -317,7 +312,6 @@ class TestLightMQTT(unittest.TestCase):
'payload_off': 'off'
}}
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, config)
@ -367,7 +361,6 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status',
}}
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, config)
@ -392,7 +385,6 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status'
}}
self.hass.config.components = set(['mqtt'])
with assert_setup_component(1):
assert setup_component(self.hass, light.DOMAIN, config)