michbeck100/pimatic-hap

Add null to the line

Closed this issue · 3 comments

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?

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

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.

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!