mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Allow spaces in group setup string
This commit is contained in:
parent
98b0367249
commit
64fff48021
@ -104,7 +104,7 @@ def setup(hass, config):
|
||||
""" Sets up all groups found definded in the configuration. """
|
||||
for name, entity_ids in config.get(DOMAIN, {}).items():
|
||||
if isinstance(entity_ids, str):
|
||||
entity_ids = entity_ids.split(",")
|
||||
entity_ids = [ent.strip() for ent in entity_ids.split(",")]
|
||||
setup_group(hass, name, entity_ids)
|
||||
|
||||
return True
|
||||
|
@ -199,7 +199,7 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
self.hass,
|
||||
{
|
||||
group.DOMAIN: {
|
||||
'second_group': self.group_entity_id + ',light.Bowl'
|
||||
'second_group': 'light.Bowl, ' + self.group_entity_id
|
||||
}
|
||||
}))
|
||||
|
||||
@ -207,6 +207,8 @@ class TestComponentsGroup(unittest.TestCase):
|
||||
group.ENTITY_ID_FORMAT.format('second_group'))
|
||||
|
||||
self.assertEqual(STATE_ON, group_state.state)
|
||||
self.assertEqual(set((self.group_entity_id, 'light.bowl')),
|
||||
set(group_state.attributes['entity_id']))
|
||||
self.assertFalse(group_state.attributes[group.ATTR_AUTO])
|
||||
|
||||
def test_groups_get_unique_names(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user