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 75e5ddfe3092327647e2873cb03ccf3b4a75b85a.

* Changed hide_switch to control
This commit is contained in:
Sebastian von Minckwitz authored and Paulus Schoutsen committed 2016-12-03 17:50:11 -08:00
1 parent 97cc76b43e
commit cf0ff54d14
2 files changed
+20 -6

No files matched your search

+4
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))