Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Add null to the line #7

Closed
rspaargaren opened this issue Nov 19, 2015 · 3 comments
Closed

Add null to the line #7

rspaargaren opened this issue Nov 19, 2015 · 3 comments

Comments

@rspaargaren
Copy link

Hi I am just reading your code, not based on any direct error just by comparing... Should there not be null added to the end of line 157 of hap.coffee? I compared it with line 190. A bulb is the same as a switch?

@michbeck100
Copy link
Owner

If omitting the last parameter (which is the optional converter callback) it will be just undefined. This is checked by 'if converter' in line 106.
But to be honest I'm not a JS pro, so I could be wrong

@rspaargaren
Copy link
Author

Are you not introducing an error if you leave it undefined as mentioned in issue #138? Better safe then sorry...

I had exactly the same console output after adding a new accessory type. It took me a while to figure out why all the accessories greyed out after restart or after the phone was out of the local network for a while. In the end it was a characteristic that returned "undefined" when queried due to a bug.
After solving the issue, everything works fine again.

@michbeck100
Copy link
Owner

You are probably right. Since i don't feel like checking for null and undefined all the time i call the method rather using all parameters. Thanks for your hint!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants