michbeck100 / pimatic-hap

Pimatic homekit bridge
GNU General Public License v2.0
30 stars 10 forks source link

Add null to the line #7

Closed rspaargaren closed 8 years ago

rspaargaren commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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!