spongioblast / node-red-contrib-local-mihome

Node Red nodes to get data from and send commands to devices connected to the local network using
GNU General Public License v3.0
1 stars 2 forks source link

Connection time out after a few minutes #5

Open mklan opened 2 years ago

mklan commented 2 years ago

Hey thanks for this project! I have an issue: after using your node for a few minutes, I get an exception stating the connection to the device (Model: zhimi.fan.za5) timed out.

In my fork it is fixed, but I changed multiple things to know what it exactly fixed. I think it is the destroying of the device after each input: https://github.com/mklan/node-red-contrib-local-mihome/blob/main/sendcommand.js#L47

Another note: You are using forEach with an asynchronous function, which won't work. In this case the property changes won't be awaited. (see https://stackoverflow.com/a/37576787) So I refactored it into an for of loop. But this won't be the cause, since I tested it always only with one property change at a time.