hello everyone,
I am new here actually and i was working of an app to communicate with eWelink supported devices but locally. I tested the concept and it works, my problem is with Homey app development i cant get it to to search for devices like any other app. when i installed it to add the devices which i created driver for it shows that there’s no devices listed. below is the driver.js code
‘use strict’;
const Homey = require(‘homey’);
const ewelink = require(‘ewelink-api’);
const {ManagerDrivers} = require(‘homey’);
module.exports = class S26Driver extends Homey.Driver {
async device_cash(email, password) {
const connection = new ewelink({ email, password });
const cash_file = await connection.getDevices();
let results = [];
for(var i = 0; i < cash_file.length; i++){
if(cash_file[i]["productModel"] == 'TX3C'){
// this.log(cash_file[i])
results = (cash_file[i]);
break;
};
};
// this.log("results", results);
return results;
}
onPairListDevices() {
const devices = await this.device_cash();
const pairs = ManagerDrivers.getDrivers();
}
async onInit() {
this.log('MyDriver has been inited');
// this.log(devices);
this.onPairListDevices();
}
}