-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homebridge-wink causes homebridge to crash if wink API is unavailable. #16
Comments
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 winfinit/wink-js#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:
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; height: 100%; }
iframe { display: block; width: 100%; border: none; }
</style>
<title>Application Error</title>
<iframe src="//s3.amazonaws.com/heroku_pages/error.html">
Application Error
</iframe>
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
<style type="text/css">
html, body, iframe { margin: 0; padding: 0; height: 100%; }
iframe { display: block; width: 100%; border: none; }
</style>
<title>Application Error</title>
<iframe src="//s3.amazonaws.com/heroku_pages/error.html">
Application Error
</iframe>
/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)
The text was updated successfully, but these errors were encountered: