Esempio n. 1
0
    def test_changing_group_visibility(self):
        """Test that a group can be hidden and shown."""
        assert setup_component(
            self.hass, "group", {"group": {"test_group": "hello.world,sensor.happy"}}
        )

        group_entity_id = group.ENTITY_ID_FORMAT.format("test_group")

        # Hide the group
        common.set_visibility(self.hass, group_entity_id, False)
        self.hass.block_till_done()
        group_state = self.hass.states.get(group_entity_id)
        assert group_state.attributes.get(ATTR_HIDDEN)

        # Show it again
        common.set_visibility(self.hass, group_entity_id, True)
        self.hass.block_till_done()
        group_state = self.hass.states.get(group_entity_id)
        assert group_state.attributes.get(ATTR_HIDDEN) is None
Esempio n. 2
0
    def test_changing_group_visibility(self):
        """Test that a group can be hidden and shown."""
        assert setup_component(self.hass, 'group', {
            'group': {
                'test_group': 'hello.world,sensor.happy'
            }
        })

        group_entity_id = group.ENTITY_ID_FORMAT.format('test_group')

        # Hide the group
        common.set_visibility(self.hass, group_entity_id, False)
        self.hass.block_till_done()
        group_state = self.hass.states.get(group_entity_id)
        self.assertTrue(group_state.attributes.get(ATTR_HIDDEN))

        # Show it again
        common.set_visibility(self.hass, group_entity_id, True)
        self.hass.block_till_done()
        group_state = self.hass.states.get(group_entity_id)
        self.assertIsNone(group_state.attributes.get(ATTR_HIDDEN))