diff --git a/homeassistant/components/group.py b/homeassistant/components/group.py index aade1493c0b..c289cca42c5 100644 --- a/homeassistant/components/group.py +++ b/homeassistant/components/group.py @@ -39,7 +39,7 @@ def _conf_preprocess(value): return value _SINGLE_GROUP_CONFIG = vol.Schema(vol.All(_conf_preprocess, { - vol.Required(CONF_ENTITIES): cv.entity_ids, + vol.Optional(CONF_ENTITIES): vol.Any(None, cv.entity_ids), CONF_VIEW: bool, CONF_NAME: str, CONF_ICON: cv.icon, @@ -145,7 +145,7 @@ def setup(hass, config): """Setup all groups found definded in the configuration.""" for object_id, conf in config.get(DOMAIN, {}).items(): name = conf.get(CONF_NAME, object_id) - entity_ids = conf[CONF_ENTITIES] + entity_ids = conf.get(CONF_ENTITIES) or [] icon = conf.get(CONF_ICON) view = conf.get(CONF_VIEW) diff --git a/tests/components/test_group.py b/tests/components/test_group.py index 8526be9768d..5c23d6ca0cd 100644 --- a/tests/components/test_group.py +++ b/tests/components/test_group.py @@ -226,6 +226,7 @@ class TestComponentsGroup(unittest.TestCase): 'view': True, }, 'test_group': 'hello.world,sensor.happy', + 'empty_group': {'name': 'Empty Group', 'entities': None}, } })