Remove service helper (5) (#16917)

* Update switch

* Update script

* Update light

* Fix tests

* Fix config/script hook

* Async_create_task

* Fix flux switch
This commit is contained in:
cdce8p authored and Paulus Schoutsen committed 2018-09-27 23:13:11 +02:00
1 parent a7248d4574
commit 70b901017f
27 files changed
+385 -316

No files matched your search

+7 -6
View File
@@ -3,12 +3,13 @@ import logging
from homeassistant.core import callback
from homeassistant import setup
import homeassistant.components as core
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import STATE_ON, STATE_OFF
from tests.common import (
get_test_home_assistant, assert_setup_component)
from tests.components.light import common
_LOGGER = logging.getLogger(__name__)
@@ -378,7 +379,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state.state == STATE_OFF
core.light.turn_on(self.hass, 'light.test_template_light')
common.turn_on(self.hass, 'light.test_template_light')
self.hass.block_till_done()
assert len(self.calls) == 1
@@ -418,7 +419,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state.state == STATE_OFF
core.light.turn_on(self.hass, 'light.test_template_light')
common.turn_on(self.hass, 'light.test_template_light')
self.hass.block_till_done()
state = self.hass.states.get('light.test_template_light')
@@ -461,7 +462,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state.state == STATE_ON
core.light.turn_off(self.hass, 'light.test_template_light')
common.turn_off(self.hass, 'light.test_template_light')
self.hass.block_till_done()
assert len(self.calls) == 1
@@ -498,7 +499,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state.state == STATE_OFF
core.light.turn_off(self.hass, 'light.test_template_light')
common.turn_off(self.hass, 'light.test_template_light')
self.hass.block_till_done()
assert len(self.calls) == 1
@@ -538,7 +539,7 @@ class TestTemplateLight:
state = self.hass.states.get('light.test_template_light')
assert state.attributes.get('brightness') is None
core.light.turn_on(
common.turn_on(
self.hass, 'light.test_template_light', **{ATTR_BRIGHTNESS: 124})
self.hass.block_till_done()
assert len(self.calls) == 1