ottoszika / node-red-contrib-ewelink

NodeRED nodes for eWeLink smart devices
https://ottoszika.github.io/node-red-contrib-ewelink
MIT License
48 stars 28 forks source link

Does not reconnect once connection is briefly interrupted #84

Open Failure404 opened 4 years ago

Failure404 commented 4 years ago

Hi and thank you kindly for your work. After restarting my router - which briefly interrupted my Internet connection - I get the following error from Node Red: UnhandledPromiseRejectionWarning: Error: Can't send data because WebSocket is not opened. at exports.throwIf (/root/.node-red/node_modules/websocket-as-promised/dist/index.js:3470:11) at WebSocketAsPromised.send (/root/.node-red/node_modules/websocket-as-promised/dist/index.js:554:7) at Timeout.setInterval [as _onTimeout] (/root/.node-red/node_modules/ewelink-api/mixins/websocket/openWebSocketMixin.js:38:17) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) e:18884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. It seems that once the connection is lost, websocket does not get reopened and node-red-contrib-ewelink becomes unusable until a full restart of Node-Red.