def get_entity_name(self, entity):
    'Get the name of an entity.'
    if ((entity.entity_id in self.entities) and (CONF_ENTITY_NAME in self.entities[entity.entity_id])):
        return self.entities[entity.entity_id][CONF_ENTITY_NAME]
    return entity.attributes.get(ATTR_EMULATED_HUE_NAME, entity.name)
Get the name of an entity.
def get_entity_name(self, entity):
    
    if ((entity.entity_id in self.entities) and (CONF_ENTITY_NAME in self.entities[entity.entity_id])):
        return self.entities[entity.entity_id][CONF_ENTITY_NAME]
    return entity.attributes.get(ATTR_EMULATED_HUE_NAME, entity.name)