song940 / node-yeelight

:bulb: A Node.js Library for the Yeelight smart bulb
https://npmjs.org/yeelight2
MIT License
87 stars 20 forks source link

Fixed bug causing execution to break out in some Raspberry tests #2

Closed sontono closed 7 years ago

sontono commented 7 years ago

It should be wonderful if bugfix was also incorporated to npm package. Thank you

song940 commented 7 years ago

don't have Location in header on raspberry pi ?

sontono commented 7 years ago

oh, yes! there is a 'Location' header on the response message as documented in the Yeelight protocol. What is happened is that, for some reason, it is processing both SSDP requests and responses as they were responses, and then the program crashes when processing a SSDP request, since it does not have 'Location' header. Adding this check everything is working ok in our tests. Thank you very much!