Closed christianguei closed 3 years ago
Here is the printscreen of the parameters on a Wifi Network.
I want to add/remove mac addresses with UniFi-Api-Client
I think i found it :
public function set_wlan_mac_filter($wlan_id, $mac_filter_policy, $mac_filter_enabled, array $macs)
{
if (!is_bool($mac_filter_enabled)) {
return false;
}
if (!in_array($mac_filter_policy, ['allow', 'deny'])) {
return false;
}
$macs = array_map('strtolower', $macs);
$payload = [
'mac_filter_enabled' => (bool) $mac_filter_enabled,
'mac_filter_policy' => $mac_filter_policy,
'mac_filter_list' => $macs
];
return $this->set_wlansettings_base($wlan_id, $payload);
}
Am i right ?
Glad you still like the class👍 Yes, that method/function should do what you’re looking achieve.
I'm almost ready ;) But i can't seem to pass the MAC address, here is my payload :
$macs = "d0:33:11:1c:72:9e";
$mac_filter_policy = "allow";
$wlan_id = "602f9d29409afc09137792a5";
$payload = [
'mac_filter_enabled' => (bool) $mac_filter_enabled,
'mac_filter_list' => $macs,
'mac_filter_policy' => $mac_filter_policy
When i remove the mac_filter_list it works ... Do you have an idea ?
Managed to do it ! :) Thanks !
The 4th parameter must be an array, not a single MAC address/string.
Beat me to it!
Beat me to it!
Yes but again you DID the job by answering and having develop this marvelous plugin ! Thanks
Thanks, not many people appreciate the amount of time it takes to maintain and support this library😉
Hello,
Hope you're well ? Thanks again for your developpement which helped me a lot.
I have a question, is it possible with your librairies to put MAC Addresses in the White/Black list of a Wifi ?
Cheers, Chris