def play_ringtone_service(call):
    'Service to play ringtone through Gateway.'
    ring_id = call.data.get(ATTR_RINGTONE_ID)
    gateway = call.data.get(ATTR_GW_MAC)
    kwargs = {'mid': ring_id}
    ring_vol = call.data.get(ATTR_RINGTONE_VOL)
    if (ring_vol is not None):
        kwargs['vol'] = ring_vol
    gateway.write_to_hub(gateway.sid, **kwargs)
Service to play ringtone through Gateway.
def play_ringtone_service(call):
    
    ring_id = call.data.get(ATTR_RINGTONE_ID)
    gateway = call.data.get(ATTR_GW_MAC)
    kwargs = {'mid': ring_id}
    ring_vol = call.data.get(ATTR_RINGTONE_VOL)
    if (ring_vol is not None):
        kwargs['vol'] = ring_vol
    gateway.write_to_hub(gateway.sid, **kwargs)