onfoot / homebridge-valetudo-xiaomi-vacuum

A Homebridge plugin for Xiaomi/Roborock vacuum cleaners running Valetudo
MIT License
31 stars 9 forks source link

unhandled error #1

Closed leonardpitzu closed 5 years ago

leonardpitzu commented 5 years ago

Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: [Wed May 01 2019 10:25:49 GMT+0300 (EEST)] [Virgil] Error parsing current status info: TypeError: "listener" argument must be a function Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: (node:9442) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'state' of null Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at getStatus (/mnt/usb/homebridge/homebridge-valetudo-xiaomi-vacuum/index.js:258:90) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at callbacks.forEach (/mnt/usb/homebridge/homebridge-valetudo-xiaomi-vacuum/index.js:155:21) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at Array.forEach () Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at sendJSONRequest.then.catch (/mnt/usb/homebridge/homebridge-valetudo-xiaomi-vacuum/index.js:154:27) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at runMicrotasksCallback (internal/process/next_tick.js:122:5) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at _combinedTickCallback (internal/process/next_tick.js:132:7) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: at process._tickCallback (internal/process/next_tick.js:181:9) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: (node:9442) 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: 3) Wed May 1 10:25:49 2019 daemon.err homebridge[9442]: (node:9442) [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.

onfoot commented 5 years ago

Sorry, it was a stupid mistake on my part. If the plugin can reach your vacuum's ip, it should update its status without throwing exceptions.

You need to update to 0.0.3.

leonardpitzu commented 5 years ago

i still get to see these errors...

Find works. Go Home and Start Cleaning are in "No response" state. Vacuum is working and is reachable over valetudo).

PS: thanks for doing this so fast - i never got around to make one myself (shame on me!)

Error parsing current status info: TypeError: "listener" argument must be a function Wed May 1 11:37:19 2019 daemon.info homebridge[14192]: [Wed May 01 2019 11:37:19 GMT+0300 (EEST)] [Virgil] Is going home? error: TypeError: "listener" argument must be a function, state: null Wed May 1 11:37:19 2019 daemon.info homebridge[14192]: [Wed May 01 2019 11:37:19 GMT+0300 (EEST)] [Virgil] Is cleaning? error: TypeError: "listener" argument must be a function, state: null

onfoot commented 5 years ago

Thanks for the feedback too! What versions of node and homebridge do you have running?

leonardpitzu commented 5 years ago

node 8.16.0 homebridge 0.4.48

onfoot commented 5 years ago

Yeah, node's version was the issue. http.request doesn't handle the url argument in this version yet. No guarantees of it working, since I don't have node 8 installed anywhere.

0.0.4 it is!

leonardpitzu commented 5 years ago

seems ok now (i updated it remote and all appears ok in homekit). you can close now the issue. thank you again for this great plugin and fast response.

onfoot commented 5 years ago

Sure thing. Still exploring some ideas to implement (within reason), so stay tuned. ;) Also, if you have any ideas for features, don't hesitate to let me know!