index.js
function addDevices(deviceArr) {
      deviceArr.forEach(function(el, i) {
        self.devices.push({
          name: deviceArr[i]['name'],
          deviceId: deviceArr[i]['id']
        });
      });
    }
function addDevices(deviceArr) {
      deviceArr.forEach(function(el, i) {
        self.devices.push({
          name: deviceArr[i]['name'],
          deviceId: deviceArr[i]['id']
        });
      });
    }
function addDevices ( deviceArr ) { deviceArr . forEach ( function ( el , i ) { self . devices . push ( { name : deviceArr [ i ] [ 'name' ] , deviceId : deviceArr [ i ] [ 'id' ] } ) ; } ) ; }
Create array of available devices from response.
Create array of available devices from response .