Art-of-WiFi / UniFi-API-browser

Tool to browse data exposed by Ubiquiti's UniFi Controller API
MIT License
1.1k stars 150 forks source link

Change PSK function #12

Closed christianmalek closed 8 years ago

christianmalek commented 8 years ago

Hi,

There is already the set_wlansettings($wlan_id, $name, $x_passphrase) function. But it would be nice to have also an set_psk function if you only want to change the psk and cannot provide the wlan's name without accessing the unifi api to get the corresponding wlan name.

malle-pietje commented 8 years ago

@Phisherman I haven't checked yet if that would work, but you will need to first access the API with the list_wlanconf() function/method anyway to get the wlan_id.

christianmalek commented 8 years ago

@malle-pietje I already have the wlan_id. I only store the wlan_id in the database because the other data like the name could change.

malle-pietje commented 8 years ago

Ah, I see. Let me check whether that would work. If so, I'll update the class and publish on github. I also have some other updates that need to be added so I'll try and combine these.

christianmalek commented 8 years ago

@malle-pietje I appreciate it!

malle-pietje commented 8 years ago

@Phisherman I just tried my modified class and it works; $name is now an optional parameter for the set_wlansettings function/method. I will update the class on github in a few minutes so please test API class version 1.0.6 when you have the opportunity, and please let me know here what the results are.

christianmalek commented 8 years ago

@malle-pietje Works like a charm.

malle-pietje commented 8 years ago

Glad to hear!