mgbowman / openhab-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
13 stars 2 forks source link

Unifi controller channel ledEnabled #2

Closed lexusburn closed 4 years ago

lexusburn commented 4 years ago

Hello Matthew,

as i told you, i had worked on my own on the feature request to handle the unifi controller setting to enable/disable AP LED.

It's working now for me and i want to give it back to you and the community.

Best Wishes

Frederic

mgbowman commented 4 years ago

Thanks for your PR!

Maybe this would be better if it were on a per AP basis. For example in my house, I have all the APs located in bedrooms turned off, yet everywhere else they are on. With this I could toggle the LEDs on / off when it's day / night.

This will require more work as there needs to be an accessPoint thing added and the led channel moved there.

I will use what I can from your code and start implementing the new accessPoint device with the appropriate channels.

lexusburn commented 4 years ago

Hello Matthew,

ok, but it seems that both implementations can be useful.

I can see that it would be much better to handle this on a AP base for you, but if anyone don't need it on AP base, he/she can use my implementation.

If i find a few minutes in the next days i can have a look how i can do this on a AP base. ;-)

Best regards Frederic

mgbowman commented 4 years ago

ok, but it seems that both implementations can be useful.

I agree. After looking at this more, I see two use case:

  1. Enable / Disable site wide
  2. Enable / Disable on a per accessPoint basis (which doesn't exist yet)

Since there's a site thing already in the model, it should be fairly easy to adapt your PR into the existing model.

If i find a few minutes in the next days i can have a look how i can do this on a AP base. ;-)

All contributions are welcome, but I recommend you study the codebase and familiarize yourself with the object model. The binding has seen many iterations and I believe I settled on a model that easily allows "features" to be added.

When I get some free time, I'll try and adapt this PR into the codebase.

Will keep you posted.