def service_handle(service):
    'Handle the applying of a service.'
    master_device_id = service.data.get('master')
    slaves_ids = service.data.get('slaves')
    slaves = []
    if slaves_ids:
        slaves = [device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id in slaves_ids)]
    master = next([device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id == master_device_id)].__iter__(), None)
    if (master is None):
        _LOGGER.warning('Unable to find master with entity_id: %s', str(master_device_id))
        return
    if (service.service == SERVICE_PLAY_EVERYWHERE):
        slaves = [d for d in hass.data[DATA_SOUNDTOUCH] if (d.entity_id != master_device_id)]
        master.create_zone(slaves)
    elif (service.service == SERVICE_CREATE_ZONE):
        master.create_zone(slaves)
    elif (service.service == SERVICE_REMOVE_ZONE_SLAVE):
        master.remove_zone_slave(slaves)
    elif (service.service == SERVICE_ADD_ZONE_SLAVE):
        master.add_zone_slave(slaves)
Handle the applying of a service.
def service_handle(service):
    
    master_device_id = service.data.get('master')
    slaves_ids = service.data.get('slaves')
    slaves = []
    if slaves_ids:
        slaves = [device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id in slaves_ids)]
    master = next([device for device in hass.data[DATA_SOUNDTOUCH] if (device.entity_id == master_device_id)].__iter__(), None)
    if (master is None):
        _LOGGER.warning('Unable to find master with entity_id: %s', str(master_device_id))
        return
    if (service.service == SERVICE_PLAY_EVERYWHERE):
        slaves = [d for d in hass.data[DATA_SOUNDTOUCH] if (d.entity_id != master_device_id)]
        master.create_zone(slaves)
    elif (service.service == SERVICE_CREATE_ZONE):
        master.create_zone(slaves)
    elif (service.service == SERVICE_REMOVE_ZONE_SLAVE):
        master.remove_zone_slave(slaves)
    elif (service.service == SERVICE_ADD_ZONE_SLAVE):
        master.add_zone_slave(slaves)