Closed andreasnuesslein closed 2 years ago
You should not wait on the connect(), but register and use the respective emitter events.
Hello @bropat thank you for your response - could you give me one example, pretty please?
in the eufysecurity.d.ts
I didn't see any emitter events that I could register to and I did find EufySecurityEvents
but I don't understand on which signal I should expect my stations to show up. is getStations()
not returning an Array<Station>
so I can grab my stations that way?
Thanks :beer:
If you were just talking about the event emitter for connect
: I did replace the connect()
with the respective listener but my stations-list stays empty
eufy.addListener("connect", async() => {
console.log("connected");
// console.log(await eufy.refreshCloudData()); // turned on and off - no difference
console.log(eufy.getStations());
});
eufy.connect()
Huhm... I kept poking at the code and now I can't reproduce the problem anymore and I do get the stations.
What I did change is, that I changed my country
. But
a) Initially I never had it set, even when it worked before and b) I did try to change it before opening this issue here, and then nothing worked - it threw errors.
Either way: it seems like this issue is resolved for now. But I'm curious to see if anybody else turns up having the same situation.
Again: thanks for this project
Client version
1.6.6
Node version
16.14.0
Operating System type
Linux
Operating system version
Ubuntu 21.10
Describe the bug
I try to use the API but only on the first run, I get a station list; on a consecutive run, it stays empty :(
To reproduce
Screenshots & Logfiles
The result is a bunch of eufy-data and then obviously an empty array.
Additional context
What I did notice, I saw some
connected: false
and someconnected: true
here and there.I thought the eufy.connect() would make sure that I was connected though? :thinking:
Maybe I'm just doing the connection wrong in the first place?