Added learn method to Device class