def test_extract_entity_ids(self):
    'Test extract_entity_ids method.'
    self.hass.states.set('light.Bowl', STATE_ON)
    self.hass.states.set('light.Ceiling', STATE_OFF)
    self.hass.states.set('light.Kitchen', STATE_OFF)
    loader.get_component(self.hass, 'group').Group.create_group(self.hass, 'test', ['light.Ceiling', 'light.Kitchen'])
    call = ha.ServiceCall('light', 'turn_on', {ATTR_ENTITY_ID: 'light.Bowl'})
    self.assertEqual(['light.bowl'], service.extract_entity_ids(self.hass, call))
    call = ha.ServiceCall('light', 'turn_on', {ATTR_ENTITY_ID: 'group.test'})
    self.assertEqual(['light.ceiling', 'light.kitchen'], service.extract_entity_ids(self.hass, call))
    self.assertEqual(['group.test'], service.extract_entity_ids(self.hass, call, expand_group=False))
Test extract_entity_ids method.
def test_extract_entity_ids(self):
    
    self.hass.states.set('light.Bowl', STATE_ON)
    self.hass.states.set('light.Ceiling', STATE_OFF)
    self.hass.states.set('light.Kitchen', STATE_OFF)
    loader.get_component(self.hass, 'group').Group.create_group(self.hass, 'test', ['light.Ceiling', 'light.Kitchen'])
    call = ha.ServiceCall('light', 'turn_on', {ATTR_ENTITY_ID: 'light.Bowl'})
    self.assertEqual(['light.bowl'], service.extract_entity_ids(self.hass, call))
    call = ha.ServiceCall('light', 'turn_on', {ATTR_ENTITY_ID: 'group.test'})
    self.assertEqual(['light.ceiling', 'light.kitchen'], service.extract_entity_ids(self.hass, call))
    self.assertEqual(['group.test'], service.extract_entity_ids(self.hass, call, expand_group=False))