naofireblade / homebridge-neato

A Neato vacuum robot plugin for homebridge.
MIT License
69 stars 18 forks source link

Support no robots #11

Closed ghulands closed 6 years ago

ghulands commented 6 years ago

I was adding support to my homebridge setup while I wait for delivery of a neato. When no robots are on the account, it kills homebridge from starting up. You should handle this better.

[2018-3-24 22:41:44] [NeatoVacuumRobot] Successful login but no robots associated with your account. /usr/lib/node_modules/homebridge-neato/index.js:39 for (var i = 0; i < that.robots.length; i++) { ^

TypeError: Cannot read property 'length' of undefined at /usr/lib/node_modules/homebridge-neato/index.js:39:36 at /usr/lib/node_modules/homebridge-neato/index.js:68:8 at Client. (/usr/lib/node_modules/homebridge-neato/node_modules/node-botvac/lib/client.js:42:17) at Request._callback (/usr/lib/node_modules/homebridge-neato/node_modules/node-botvac/lib/api.js:42:45) at Request.self.callback (/usr/lib/node_modules/homebridge-neato/node_modules/request/request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (/usr/lib/node_modules/homebridge-neato/node_modules/request/request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7)