Match each device to a category.