Skip to content
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

Discovery Feature #2

Merged
merged 5 commits into from
May 16, 2018
Merged

Discovery Feature #2

merged 5 commits into from
May 16, 2018

Conversation

edeuxk
Copy link
Contributor

@edeuxk edeuxk commented May 15, 2018

Create a child process with python.
Created python script to discover lights in the local network.
Discovery.scan() : Promise, return an array.
Compatible python version 2/3+

Need improvement : should use Node.JS sockets instead of spawning a python script. (https://nodejs.org/api/dgram.html)

Current result:
screen shot 2018-05-15 at 1 46 51 pm

@edeuxk edeuxk mentioned this pull request May 15, 2018
@jangxx
Copy link
Owner

jangxx commented May 16, 2018

Hey, thanks a lot for your contribution, the Discovery Mode is a pretty important feature of the original python tool and it would be great to have it in the node version as well.
Before I merge it however, I would like you to do two things:

  1. Please port the python component to Javascript, so this module can stay a pure Javascript implementation. Mixing different languages in a node module is not nice.
  2. Please have the scan method take a callback in addition to returning a Promise, so that we can keep the API somewhat consistent, in that every method takes a callback. In the future I (or someone else :D) will update the methods of the Control class to return Promises as well.

If you do these two things, I'll happily merge your work into this module and submit an updated version to npm :)

@jangxx jangxx self-assigned this May 16, 2018
@jangxx jangxx removed their assignment May 16, 2018
@edeuxk
Copy link
Contributor Author

edeuxk commented May 16, 2018

Totally agree with the fact that mixing different language in a node module is not nice but it was the fastest way to do a POC.

I'll do the two things and update the pull request :)

@edeuxk
Copy link
Contributor Author

edeuxk commented May 16, 2018

@jangxx Everything is done.

@jangxx jangxx merged commit 45e8690 into jangxx:master May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants