Open rykm48 opened 1 month ago
You can modify the code to figure out what the response is from the API
Put in a console.log and maybe there’s an error.
where do i put im console.log? im not sure what to type where
the exact steps i did to get this far is in ubuntu terminal git clone https://github.com/gtalusan/eufy-device-id-js cd eufy-device-id-js npm install and then ran node index.js "myemail@gmail.com" "password123"
Not sure if Copilot is doing something wrong or what... but look for this code:
async login() {
const response = await this.session.post(this.url('user/email/login'), {
client_Secret: EUFY_CLIENT_SECRET,
client_id: EUFY_CLIENT_ID,
email: this.email,
password: this.password
});
const data = response.data;
this.session.defaults.headers['uid'] = data.user_info.id;
this.session.defaults.headers['token'] = data.access_token;
this.base_url = data.user_info.request_host;
}
This is in the file clients.js, in the class EufyHomeSession (which Copilot claims to not exist). Find:
const data = response.data;
and change to:
const data = response.data
console.log(data);
and re-run it.
found it, thank you!! log told me my login was incorrect however i know the password is correct, upon looking in the eufy app i forgot to add the +eufy to my email address in my password manager
Great, you're welcome and happy to help!
when i run hbadmin@homebridge-ubuntu:~/eufy-device-id-js$ node index.js "myemail@gmail.com" "mypassword" i get the following error message
Error: TypeError: Cannot read properties of undefined (reading 'id') at EufyHomeSession.login (/home/hbadmin/eufy-device-id-js/lib/clients.js:77:63) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async EufyHomeSession._request (/home/hbadmin/eufy-device-id-js/lib/clients.js:84:13) at async /home/hbadmin/eufy-device-id-js/index.js:14:22