ChrisScheffler / miflora

Node.js package for the Xiaomi Plant Sensor Flower Care (Mi Flora)
MIT License
43 stars 12 forks source link

MiFlora.discover() not returning if devices are already known #5

Closed jnooraga closed 3 years ago

jnooraga commented 3 years ago

I've found an issue in the miflora module where the MiFlora.discover() method will not resolve the open promise if the devices have already been previously discovered. I've verified that adding a new line:

miflora.js line 162: return resolve();

fixes this issue. Please consider adding this fix. Thanks!

jnooraga commented 3 years ago

Turns out this causes it to only return one device. Ignore my fix suggestion.

ChrisScheffler commented 3 years ago

Could you please check v1.0.6? I might have fixed your issue. As I cannot reproduce your problem I might be wrong.