Group service / dynamic handling (#7971)

* Add Service to group

* Finish service

* Add service functions

* fix lint

* Address paulus comments

* fix lint & cleanup

* fix lint

* fix lint

* fix lint p3

* add test for check group

* add more tests

* fix lint

* Update service.yaml

* Fix order for tests

* Fix comment

* Fix test

* Fix tests

* Fix name in tests

* Fix view

* Fix default value

* Fix lint

* Fix key error

* add name

* migrate component entity

* fix tests

* fix import

* migrate device tracker

* fix lint

* fix bug

* fix logic

* fix lint

* fix tests

* fix generator

* fix group

* fix other tests.

* Not need to load group on first stage anymore.

* fix service

* add more group depency

* fix tests

* Revert "fix tests"

This reverts commit 35a922b3a8d00821a00d153997b7be57117de328.

* Real fix

* fix test p2

* fix test p3

* fix test p4

* fix test p5

* fix test p6

* fix lint

* fix test p7

* Rename attribute

* fix group test

* fix bug

* fix flagy tests

* fix service.yaml

* fix lint
This commit is contained in:
Pascal Vizeli 2017-06-16 00:52:28 +02:00 committed by GitHub
parent 46f3088a70
commit 814834512a
27 changed files with 444 additions and 168 deletions

View file

@ -151,7 +151,7 @@ class TestLightMQTT(unittest.TestCase):
def test_fail_setup_if_no_command_topic(self):
"""Test if command fails with command topic."""
with assert_setup_component(0):
with assert_setup_component(0, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
'platform': 'mqtt',
@ -163,7 +163,7 @@ class TestLightMQTT(unittest.TestCase):
def test_no_color_brightness_color_temp_white_xy_if_no_topics(self): \
# pylint: disable=invalid-name
"""Test if there is no color and brightness if no topic."""
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
'platform': 'mqtt',
@ -217,7 +217,7 @@ class TestLightMQTT(unittest.TestCase):
'payload_off': 0
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -301,7 +301,7 @@ class TestLightMQTT(unittest.TestCase):
def test_brightness_controlling_scale(self):
"""Test the brightness controlling scale."""
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
'platform': 'mqtt',
@ -348,7 +348,7 @@ class TestLightMQTT(unittest.TestCase):
def test_white_value_controlling_scale(self):
"""Test the white_value controlling scale."""
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, {
light.DOMAIN: {
'platform': 'mqtt',
@ -416,7 +416,7 @@ class TestLightMQTT(unittest.TestCase):
'xy_value_template': '{{ value_json.hello | join(",") }}',
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -467,7 +467,7 @@ class TestLightMQTT(unittest.TestCase):
'payload_off': 'off'
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -522,7 +522,7 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status',
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -546,7 +546,7 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status'
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -570,7 +570,7 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status'
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -594,7 +594,7 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status',
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')
@ -618,7 +618,7 @@ class TestLightMQTT(unittest.TestCase):
'state_topic': 'test_light_rgb/status',
}}
with assert_setup_component(1):
with assert_setup_component(1, light.DOMAIN):
assert setup_component(self.hass, light.DOMAIN, config)
state = self.hass.states.get('light.test')