'Retrieve all of a user\'s registered devices.
Args:
user_id (str):
Returns:
defer.Deferred: resolves to a dict from device_id to a dict
containing "device_id", "user_id" and "display_name" for each
device.'

@defer.inlineCallbacks
def get_devices_by_user(self, user_id):

    devices = (yield self._simple_select_list(table='devices', keyvalues={'user_id': user_id}, retcols=('user_id', 'device_id', 'display_name'), desc='get_devices_by_user'))
    defer.returnValue({d['device_id']: d for d in devices})
