rootnegativ1 / unifi-wifi

Home Assistant integration to change wireless passwords on UniFi Network controllers
MIT License
3 stars 0 forks source link

Guest hotspot password #39

Closed permster closed 4 months ago

permster commented 4 months ago

Any possibility of adding support for the guest hotspot password as well? I believe it would be a PUT rest call to "rest/setting/guest_access".

Also I was curious if you've ever thought of using this module here instead of rolling your own code to interface with the controller? That module exposes most of the controller api's.

I'll try and fork this when I have a minute to attempt adding the functionality I mentioned above but thought I would ask in the meantime. Thanks!

rootnegativ1 commented 4 months ago

Any possibility of adding support for the guest hotspot password

Not having used the hotspot manager much, it didn't even occur to me. I think I worked out the rest call code. All that's left is to figure out how to expose this option. The hotspot doesn't seem to be SSID specific, so the current HA services don't really work. I think the most sensible thing would be another service, specific to each host+site/coordinator/controller combo, to change the guest access password. Hmmm. I'll try to work on this soon; work life is in crunch mode right now.

instead of rolling your own code

To be honest, this project has been a way for me to learn Python. Doing it this way may not be the fastest, but it's definitely the most beneficial (to me). I suppose one of these days I should stop re-inventing the wheel . . . eventually.

rootnegativ1 commented 4 months ago

I just pushed a pre-release version with hotspot password support. Would you be available to test the new service?

permster commented 4 months ago

So appreciative of your work on this. I didn't realize you were going to have this so quick that I ended up writing a pyscript to do this. Guess it was a good excuse to learn more about pyscript but using this is much simpler.

I tested the new version and so far things look great. I've tested the hotspot password both using the developer tools and a hard coded password and via an automation where I'm setting the password using a template value. Both work great. Haven't tested any other functionality but at least the hotspot password looks good.

rootnegativ1 commented 4 months ago

Glad it's working well. Thanks for the feature suggestion!