#NEWLINE# def extract_entity_ids( hass , service_call ) : #NEWLINE# #INDENT# 'Helper method to extract a list of entity ids from a service call.\n\n    Will convert group entity ids to the entity ids it represents.\n    ' #NEWLINE# if ( not ( service_call . data and ( ATTR_ENTITY_ID in service_call . data ) ) ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# group = get_component ( 'group' ) #NEWLINE# service_ent_id = service_call . data [ ATTR_ENTITY_ID ] #NEWLINE# if isinstance ( service_ent_id , str ) : #NEWLINE# #INDENT# return group . expand_entity_ids ( hass , [ service_ent_id ] ) #NEWLINE# #UNINDENT# return [ ent_id for ent_id in group . expand_entity_ids ( hass , service_ent_id ) ]