Closed msroest closed 8 years ago
Looking at the stack trace closer this actually seems to be an issue with wink-js. I'm working on a branch to handle the exception out of wink-js
I've created a PR in https://github.com/winfinit/wink-js/pull/4 for fixing the underlying issue in wink-js. I need to spend more time learning the node.js async error handling to see how to handle this on the homebridge-wink side if the wink-js issue doesn't get fixed.
Thank you. Looks like wink-js needs a new npm publish as well. The one on the wink-js github fixes the issue of the huge data dump to the console by putting it into a debug output instead of console.
Yah I asked in the issue we'll see if he gets it out.
Looks like the npm module has been updated. I think you just need to run "npm update" on homebridge?
Nope an update doesn't work. the packages.json is defining ^0.0.9. The wink-js update was done as version 0.1.0 and so it doesn't update to it. I've open a PR to fix this we'll need a new release though.
Well according to https://www.npmjs.com/package/semver the ^0.1.0 will get be 0.1.0 <= ver < 0.2.0 I guess it depends on how @winfinit is planning on versioning wink-js. Based on the semver info ^0.1.0 is correct as 0.1.x should guarantee no breaking api changes where >0.1.0 things could break as a 0.2.0 could have a incompatible API change.
That makes a lot more sense. Thanks for that explanation.
Although I am not fully complying to "semver", however I do strongly agree with "semver" summary:
so you can feel safe to update MINOR version.
Great thanks @winfinit so I'll update it to be 0.1.0 < ver < 1.0.0 then.
Released in 1.0.3
[Wink] Refreshing Wink Data response in http: <!DOCTYPE html>
SyntaxError: Unexpected token < at Object.parse (native) at IncomingMessage. (/usr/lib/node_modules/homebridge-wink/node_modules/wink-js/index.js:67:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:478:9)
at process._tickCallback (node.js:392:17)
raw message <!DOCTYPE html>
/usr/lib/node_modules/homebridge-wink/node_modules/wink-js/index.js:223 for( var dataIndex in data.data ) { ^
TypeError: Cannot read property 'data' of undefined at /usr/lib/node_modules/homebridge-wink/node_modules/wink-js/index.js:223:41 at IncomingMessage. (/usr/lib/node_modules/homebridge-wink/node_modules/wink-js/index.js:74:7)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:478:9)
at process._tickCallback (node.js:392:17)