From 19a43cea263d89c8ab32ccfd16bade00929346af Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 15 Mar 2015 23:36:42 -0700 Subject: [PATCH] Add scene component --- config/configuration.yaml.example | 9 + homeassistant/components/api.py | 2 +- homeassistant/components/frontend/version.py | 2 +- .../frontend/www_static/frontend.html | 71 ++++--- .../www_static/polymer/home-assistant-js | 2 +- .../polymer/layouts/home-assistant-main.html | 56 ++++-- .../polymer/layouts/partial-states.html | 43 ++-- .../resources/home-assistant-icons.html | 3 + .../polymer/resources/home-assistant-js.html | 12 +- homeassistant/components/scene.py | 183 ++++++++++++++++++ homeassistant/helpers/__init__.py | 21 -- homeassistant/helpers/device_component.py | 64 +++--- homeassistant/helpers/state.py | 52 +++++ 13 files changed, 382 insertions(+), 138 deletions(-) create mode 100644 homeassistant/components/scene.py create mode 100644 homeassistant/helpers/state.py diff --git a/config/configuration.yaml.example b/config/configuration.yaml.example index 49886682507..6c0d9f64a1f 100644 --- a/config/configuration.yaml.example +++ b/config/configuration.yaml.example @@ -139,3 +139,12 @@ script: execute_service: light.turn_on service_data: entity_id: group.living_room + +scene: + - name: Romantic + entities: + light.tv_back_light: on + light.ceiling: + state: on + color: [0.33, 0.66] + brightness: 200 diff --git a/homeassistant/components/api.py b/homeassistant/components/api.py index a29b81e3cba..ebb632b95ab 100644 --- a/homeassistant/components/api.py +++ b/homeassistant/components/api.py @@ -10,7 +10,7 @@ import threading import json import homeassistant as ha -from homeassistant.helpers import TrackStates +from homeassistant.helpers.state import TrackStates import homeassistant.remote as rem from homeassistant.const import ( URL_API, URL_API_STATES, URL_API_EVENTS, URL_API_SERVICES, URL_API_STREAM, diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 993fd80c040..a4b93bdf19b 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "da527496648e2c85d7a5f8c261c18466" +VERSION = "1d8b14c387123a4b42fec6b8f9346675" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index c8f20e327bd..84b550ecffc 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -1,12 +1,10 @@ -