From 4cadc7df963f39f650c8e889d0bfb1bfb802e998 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 30 Aug 2015 13:48:40 -0700 Subject: [PATCH] Update demo component --- homeassistant/components/demo.py | 10 +++++----- homeassistant/components/light/demo.py | 9 ++++----- homeassistant/components/switch/demo.py | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index 71621502878..5dc91b28370 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -46,12 +46,12 @@ def setup(hass, config): hass, component, {component: {CONF_PLATFORM: 'demo'}}) # Setup room groups - lights = hass.states.entity_ids('light') - switches = hass.states.entity_ids('switch') + lights = sorted(hass.states.entity_ids('light')) + switches = sorted(hass.states.entity_ids('switch')) media_players = sorted(hass.states.entity_ids('media_player')) - group.setup_group(hass, 'living room', [lights[0], lights[1], switches[0], + group.setup_group(hass, 'living room', [lights[2], lights[1], switches[0], media_players[1]]) - group.setup_group(hass, 'bedroom', [lights[2], switches[1], + group.setup_group(hass, 'bedroom', [lights[0], switches[1], media_players[0]]) # Setup IP Camera @@ -68,7 +68,7 @@ def setup(hass, config): hass, 'script', {'script': { 'demo': { - 'alias': 'Demo {}'.format(lights[0]), + 'alias': 'Toggle {}'.format(lights[0].split('.')[1]), 'sequence': [{ 'execute_service': 'light.turn_off', 'service_data': {ATTR_ENTITY_ID: lights[0]} diff --git a/homeassistant/components/light/demo.py b/homeassistant/components/light/demo.py index 5c6b1ae6165..40a8cc023c5 100644 --- a/homeassistant/components/light/demo.py +++ b/homeassistant/components/light/demo.py @@ -12,9 +12,8 @@ from homeassistant.components.light import ( LIGHT_COLORS = [ - [0.861, 0.3259], - [0.6389, 0.3028], - [0.1684, 0.0416] + [0.368, 0.180], + [0.460, 0.470], ] @@ -22,8 +21,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return demo lights. """ add_devices_callback([ DemoLight("Bed Light", False), - DemoLight("Ceiling", True), - DemoLight("Kitchen", True) + DemoLight("Ceiling Lights", True, LIGHT_COLORS[0]), + DemoLight("Kitchen Lights", True, LIGHT_COLORS[1]) ]) diff --git a/homeassistant/components/switch/demo.py b/homeassistant/components/switch/demo.py index 7b2f077d6a8..c097722ac4d 100644 --- a/homeassistant/components/switch/demo.py +++ b/homeassistant/components/switch/demo.py @@ -13,7 +13,7 @@ from homeassistant.const import DEVICE_DEFAULT_NAME def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Find and return demo switches. """ add_devices_callback([ - DemoSwitch('Ceiling', True), + DemoSwitch('Decorative Lights', True), DemoSwitch('AC', False) ])