From d2d393feb53e32cffb98a8b0ad610c14a373733e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Wed, 5 Oct 2016 06:20:48 +0200 Subject: [PATCH] Add automations and scripts to group.all_automations and group.all_scripts (#3664) * Add automations to group.all_automations * Add scripts to group.all_scripts --- homeassistant/components/automation/__init__.py | 5 ++++- homeassistant/components/script.py | 4 +++- tests/components/automation/test_init.py | 4 ++++ tests/components/test_script.py | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/automation/__init__.py b/homeassistant/components/automation/__init__.py index 579d4b40003..25754d32ead 100644 --- a/homeassistant/components/automation/__init__.py +++ b/homeassistant/components/automation/__init__.py @@ -31,6 +31,8 @@ ENTITY_ID_FORMAT = DOMAIN + '.{}' DEPENDENCIES = ['group'] +GROUP_NAME_ALL_AUTOMATIONS = 'all automations' + CONF_ALIAS = 'alias' CONF_HIDE_ENTITY = 'hide_entity' @@ -139,7 +141,8 @@ def reload(hass): def setup(hass, config): """Setup the automation.""" - component = EntityComponent(_LOGGER, DOMAIN, hass) + component = EntityComponent(_LOGGER, DOMAIN, hass, + group_name=GROUP_NAME_ALL_AUTOMATIONS) success = run_coroutine_threadsafe( _async_process_config(hass, config, component), hass.loop).result() diff --git a/homeassistant/components/script.py b/homeassistant/components/script.py index 961c37f896a..dfaa6b250b0 100644 --- a/homeassistant/components/script.py +++ b/homeassistant/components/script.py @@ -23,6 +23,7 @@ from homeassistant.helpers.script import Script DOMAIN = "script" ENTITY_ID_FORMAT = DOMAIN + '.{}' +GROUP_NAME_ALL_SCRIPTS = 'all scripts' DEPENDENCIES = ["group"] CONF_SEQUENCE = "sequence" @@ -73,7 +74,8 @@ def toggle(hass, entity_id): def setup(hass, config): """Load the scripts from the configuration.""" - component = EntityComponent(_LOGGER, DOMAIN, hass) + component = EntityComponent(_LOGGER, DOMAIN, hass, + group_name=GROUP_NAME_ALL_SCRIPTS) def service_handler(service): """Execute a service call to script.