Refactored device components

This commit is contained in:
Paulus Schoutsen committed 2015-03-01 01:35:58 -08:00
1 parent f0c6ac1aa3
commit 89100d14c8
20 files changed
+239 -339

No files matched your search

@@ -27,8 +27,3 @@ def init(empty=False):
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Returns mock devices. """
add_devices_callback(DEVICES)
def get_lights():
""" Helper method to get current light objects. """
return DEVICES
@@ -24,6 +24,6 @@ def init(empty=False):
]
def get_switches(hass, config):
""" Returns mock devices. """
return DEVICES
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Find and return test switches. """
add_devices_callback(DEVICES)
+2 -2
View File
@@ -103,7 +103,7 @@ class TestLight(unittest.TestCase):
self.assertTrue(
light.setup(self.hass, {light.DOMAIN: {CONF_TYPE: 'test'}}))
dev1, dev2, dev3 = platform.get_lights()
dev1, dev2, dev3 = platform.DEVICES
# Test init
self.assertTrue(light.is_on(self.hass, dev1.entity_id))
@@ -244,7 +244,7 @@ class TestLight(unittest.TestCase):
self.hass, {light.DOMAIN: {CONF_TYPE: 'test'}}
))
dev1, dev2, dev3 = platform.get_lights()
dev1, dev2, dev3 = platform.DEVICES
light.turn_on(self.hass, dev1.entity_id, profile='test')
+1 -1
View File
@@ -30,7 +30,7 @@ class TestSwitch(unittest.TestCase):
# Switch 1 is ON, switch 2 is OFF
self.switch_1, self.switch_2, self.switch_3 = \
platform.get_switches(None, None)
platform.DEVICES
def tearDown(self): # pylint: disable=invalid-name
""" Stop down stuff we started. """