donavanbecker / homebridge-rainbird

The Homebridge RainBird plugin allows you to access your RainBird Controller from HomeKit with Homebridge.
ISC License
20 stars 0 forks source link

Usage of RainbirdService for Homey integration #513

Closed sorted-bits closed 6 months ago

sorted-bits commented 7 months ago

Problem

First of all, just wanted to thank you on the great work on this project. While I am not a Homebridge user, I am a Homey user and that was missing Rainbird integration. After I found this repo I grabbed your Rainbird implementation to add support to Homey.

Solution

I would love the Rainbird integration part to be split from the Homebridge integration, so that it is easier to incorporate. I had to change some minor stuff to make it compatible with Homey (e.g. the logging, but also made some methods public, instead of private).

Maybe it could be split off in a new repository, so that it's easier to incorporate in more projects?

Alternatives

No response

Additional context

As I am a bit of a noob with licenses, I am not sure how I should work with this. You can find my repo here: https://github.com/sorted-bits/com.sortedbits.rainbird

mantorok1 commented 7 months ago

Hi @sorted-bits, thanks for the feedback.

From what I gather you'd like to have the classes that handle the communication with the RainBird controller split off into its own Library - a seperate NPM package. Is that correct? If so is it just the code in the src/RainBird folder you are interested in?

BTW, there are other existing packages that may be worth looking at:

sorted-bits commented 7 months ago

Thanks @mantorok1 for answering, the notification of your reply was swallowed because of the work notifications. So sorry for the late reply.

So, what I did was, I indeed copied src/Rainbird to my own repo and updated a couple of tiny things to make it compatible with the way Homey queries/receives updates.

I know that this request might involve a bit of work, but as far as my investigation goes, your version has the cleanest code and is actually readable. One of the things I would love to chat about then is how we could lose the dependancy on the Logger from Homebridge and replace it with something a bit more generic (although, the signatures are really not that different from eachother).

I tried the alternatives, but they either needed a rewrite in nodejs or are not as readable/clean as this solution.

donavanbecker commented 7 months ago

@sorted-bits We have created repo RainBird which does separate the plugin from the library if you can give it a try and let us know. FYI, this is a ES module.

sorted-bits commented 6 months ago

Sorry for the super late response, but this is awesome. I am currently rewriting my Homey app to use this!

Thanks so much and let me close this issue.