LAN API implementation in TypeScript

I implemented an interface to the LIFX API in TypeScript. I based in on node-lifx-lan but made major cleanups taking advantage of TypeScript. My style is, well, eclectic, but I used TypeScript’s type hinting and async to make the code as readable as I can. It also makes it easier to see the internal information flows. I also remove redundant code.

It fully works (at least for me) support nearly all of the Lifx capabilities but I hesitate to share it widely unless there is some interest in sharing responsibility and bringing it up to Github standards.

Sounds cool. I don’t see why you wouldn’t put it up on your own github.

It is on my own – I just haven’t shared it yet because I fear having to support it but if you give me your Github persona I’ll give you full access. The ideal result woudl be for LIFX to adopt it.

Or rewrite it and make it much better.

Oh, I can’t commit any time to other people’s projects!

But a project doesn’t have to be supported (or even used) to put up on github!

I know it doesn’t need to be supported but I do have standards. Perhaps it goes back to an the Multics submission process which was similar and relied on peer review. OK, it was half a century ago but little changes.

In this case it’s fleshing out the documentation.

I also want to become a tad more proficient on Github.

Bob Frankston

Fair enough. At the end of the day do what makes you comfortable!

@BobFrankston post it, I have been toying with this exact type of setup. The typescript community is definitely growing, I think you might find individuals, such as myself, who’d be interested in contributing!

1 Like

Sounds, really great. There has already been interest in converting node-lifx to a TypeScript project from other people in the community. So there might be some people to help you with support. I don’t find the time either to support node-lifx the way it would be needed but that was not a reason to not release it publicly.

1 Like

OK, I’ll risk it and discover what happens. It’s currently BobFrankston/lzlan.


Can you explain why you feel groups and filtering are not useful for the LAN API?

All the filter / group code did is an arbitrary selection of the individual devices and then sent individual commands. It may have made sense for a cloud-based implementation to avoid round trips but it saved no network activity locally. You can easily implement such policies in applications code plus many more using a simple .map call in JavaScript.