'Register a device to receive push messages.'

def register(self, call):

    push_id = call.data.get(ATTR_PUSH_ID)
    device_name = call.data.get(ATTR_NAME)
    current_device = self.devices.get(push_id)
    current_tracking_id = (None if (current_device is None) else current_device.tracking_device_id)
    device = ApnsDevice(push_id, device_name, current_tracking_id)
    if (current_device is None):
        self.devices[push_id] = device
        with open(self.yaml_path, 'a') as out:
            _write_device(out, device)
        return True
    if (device != current_device):
        self.devices[push_id] = device
        self.write_devices()
    return True
