From f6c53896e301c8588531d142a40f93a381852d9b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 24 Jan 2016 14:13:39 -0800 Subject: [PATCH] Allow groups to be used as views --- homeassistant/components/demo.py | 8 +- .../components/device_tracker/__init__.py | 2 +- homeassistant/components/frontend/version.py | 2 +- .../frontend/www_static/frontend.html | 200 +++++++++++++++--- .../www_static/home-assistant-polymer | 2 +- homeassistant/components/group.py | 60 ++++-- homeassistant/const.py | 1 + tests/components/test_group.py | 36 +++- tests/components/test_zone.py | 10 +- tests/helpers/test_service.py | 2 +- 10 files changed, 256 insertions(+), 67 deletions(-) diff --git a/homeassistant/components/demo.py b/homeassistant/components/demo.py index 8b4b3fcce6c..348ba0f645b 100644 --- a/homeassistant/components/demo.py +++ b/homeassistant/components/demo.py @@ -62,10 +62,10 @@ def setup(hass, config): 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[2], lights[1], switches[0], - media_players[1]]) - group.setup_group(hass, 'bedroom', [lights[0], switches[1], - media_players[0]]) + group.Group(hass, 'living room', [lights[2], lights[1], switches[0], + media_players[1]]) + group.Group(hass, 'bedroom', [lights[0], switches[1], + media_players[0]]) # Setup scripts bootstrap.setup_component( diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index 204d845084c..c5b4ccd1c16 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -229,7 +229,7 @@ class DeviceTracker(object): """ Initializes group for all tracked devices. """ entity_ids = (dev.entity_id for dev in self.devices.values() if dev.track) - self.group = group.setup_group( + self.group = group.Group( self.hass, GROUP_NAME_ALL_DEVICES, entity_ids, False) def update_stale(self, now): diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index b8a31e418ca..5220dee892e 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 = "1003c31441ec44b3db84b49980f736a7" +VERSION = "5acc1c32156966aef67ca45a1e677eae" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 1816b922342..0cdea3a6b02 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -1437,7 +1437,7 @@ var n=this._rootDataHost;return n?n._scopeElementClass(t,e):void 0},stamp:functi left: 0; }; - }