예제 #1
0
    def test_modify_group(self):
        """Test modifying a group."""
        group_conf = OrderedDict()
        group_conf["modify_group"] = {"name": "friendly_name", "icon": "mdi:work"}

        assert setup_component(self.hass, "group", {"group": group_conf})

        # The old way would create a new group modify_group1 because
        # internally it didn't know anything about those created in the config
        common.set_group(self.hass, "modify_group", icon="mdi:play")
        self.hass.block_till_done()

        group_state = self.hass.states.get(f"{group.DOMAIN}.modify_group")

        assert self.hass.states.entity_ids() == ["group.modify_group"]
        assert group_state.attributes.get(ATTR_ICON) == "mdi:play"
        assert group_state.attributes.get(ATTR_FRIENDLY_NAME) == "friendly_name"
예제 #2
0
    def test_modify_group(self):
        """Test modifying a group."""
        group_conf = OrderedDict()
        group_conf['modify_group'] = {
            'name': 'friendly_name',
            'icon': 'mdi:work'
        }

        assert setup_component(self.hass, 'group', {'group': group_conf})

        # The old way would create a new group modify_group1 because
        # internally it didn't know anything about those created in the config
        common.set_group(self.hass, 'modify_group', icon="mdi:play")
        self.hass.block_till_done()

        group_state = self.hass.states.get(
            group.ENTITY_ID_FORMAT.format('modify_group'))

        assert self.hass.states.entity_ids() == ['group.modify_group']
        assert group_state.attributes.get(ATTR_ICON) == 'mdi:play'
        assert group_state.attributes.get(ATTR_FRIENDLY_NAME) == \
            'friendly_name'
예제 #3
0
    def test_modify_group(self):
        """Test modifying a group."""
        group_conf = OrderedDict()
        group_conf['modify_group'] = {
            'name': 'friendly_name',
            'icon': 'mdi:work'
        }

        assert setup_component(self.hass, 'group', {'group': group_conf})

        # The old way would create a new group modify_group1 because
        # internally it didn't know anything about those created in the config
        common.set_group(self.hass, 'modify_group', icon="mdi:play")
        self.hass.block_till_done()

        group_state = self.hass.states.get(
            group.ENTITY_ID_FORMAT.format('modify_group'))

        assert self.hass.states.entity_ids() == ['group.modify_group']
        assert group_state.attributes.get(ATTR_ICON) == 'mdi:play'
        assert group_state.attributes.get(ATTR_FRIENDLY_NAME) == \
            'friendly_name'