Add option to hide the group card switch (#4631)

* Add option to hide the group card switch

* Disallow control of hidden group switches

* Revert "Disallow control of hidden group switches"

This reverts commit 75e5ddfe30.

* Changed hide_switch to control
This commit is contained in:
Sebastian von Minckwitz 2016-12-04 02:50:11 +01:00 committed by Paulus Schoutsen
parent 97cc76b43e
commit cf0ff54d14
2 changed files with 20 additions and 6 deletions

View file

@ -228,6 +228,7 @@ class TestComponentsGroup(unittest.TestCase):
'entities': 'light.Bowl, ' + test_group.entity_id,
'icon': 'mdi:work',
'view': True,
'control': 'hidden',
}
group_conf['test_group'] = 'hello.world,sensor.happy'
group_conf['empty_group'] = {'name': 'Empty Group', 'entities': None}
@ -243,6 +244,8 @@ class TestComponentsGroup(unittest.TestCase):
self.assertEqual('mdi:work',
group_state.attributes.get(ATTR_ICON))
self.assertTrue(group_state.attributes.get(group.ATTR_VIEW))
self.assertEqual('hidden',
group_state.attributes.get(group.ATTR_CONTROL))
self.assertTrue(group_state.attributes.get(ATTR_HIDDEN))
self.assertEqual(1, group_state.attributes.get(group.ATTR_ORDER))
@ -254,6 +257,7 @@ class TestComponentsGroup(unittest.TestCase):
self.assertIsNone(group_state.attributes.get(group.ATTR_AUTO))
self.assertIsNone(group_state.attributes.get(ATTR_ICON))
self.assertIsNone(group_state.attributes.get(group.ATTR_VIEW))
self.assertIsNone(group_state.attributes.get(group.ATTR_CONTROL))
self.assertIsNone(group_state.attributes.get(ATTR_HIDDEN))
self.assertEqual(2, group_state.attributes.get(group.ATTR_ORDER))