Giter Site home page Giter Site logo

Comments (4)

ristomatti avatar ristomatti commented on August 11, 2024

It seems superfluous to add a udp listener myself ontop of the already instantiated existing udp listener in node-lifx...

Could you describe in more detail what are you trying to achieve? The library does not have a network API that would listen for external commands commands. It binds to a UDP port for sending commands to lights and receiving status request responses.

To achieve what you describe, you would need to create some proxy/wrapper around the library. I cannot speak for @MariusRumpf but I doubt there are any plans of adding this type of functionality. I think it would be better suited for a separate module and would likely be a marginal use case.

from node-lifx.

MariusRumpf avatar MariusRumpf commented on August 11, 2024

I am with you there @ristomatti this is nothing we support, or which I see make sense for a broader audience. Besides this if needed one might write a wrapper library which does this.

from node-lifx.

koraysels avatar koraysels commented on August 11, 2024

But in the cli.js example there is a listener already setup? And if i create another udp listener i have to chose another port which is not supported by my home Automation System. This library uses the node udp4 package So it has a listener. If i send commando to it it does somthing with it.. like in cli.js i just was wonderkind what it does and hoe it expects the udp call to be formatted. The rest i will weird myself. This is more a request for help than a feature request. Because i think it is already there....

from node-lifx.

MariusRumpf avatar MariusRumpf commented on August 11, 2024

The Client class opens the udp4 socket, right. It keeps it itself as reference in the socket variable found here. You can get that socket from there in your wrapper library.
This library adds his own message queue to support rate limits for sending and message listeners in order to keep track of bulb states. This might be a problem for you when using the same socket. Another problem when using the same port would be that you send your udp message to the lifx lights too, since the processing capacity of the lights is limited and you "spam" the traffic with unneeded packages besides the unknown effects to the message content. I would not go for an approach like this where you use the same port.

from node-lifx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.