UniFi - Add block network access control to config option (#32004)

* Add block network access control to config option

* Clean up
This commit is contained in:
Paulus Schoutsen
2020-03-04 21:55:56 -08:00
committed by GitHub
parent 1615a5ee81
commit d216c1f2ac
9 changed files with 314 additions and 104 deletions

View File

@@ -31,9 +31,7 @@ from .const import (
CONF_TRACK_WIRED_CLIENTS,
CONTROLLER_ID,
DEFAULT_ALLOW_BANDWIDTH_SENSORS,
DEFAULT_BLOCK_CLIENTS,
DEFAULT_DETECTION_TIME,
DEFAULT_SSID_FILTER,
DEFAULT_TRACK_CLIENTS,
DEFAULT_TRACK_DEVICES,
DEFAULT_TRACK_WIRED_CLIENTS,
@@ -99,7 +97,7 @@ class UniFiController:
@property
def option_block_clients(self):
"""Config entry option with list of clients to control network access."""
return self.config_entry.options.get(CONF_BLOCK_CLIENT, DEFAULT_BLOCK_CLIENTS)
return self.config_entry.options.get(CONF_BLOCK_CLIENT, [])
@property
def option_track_clients(self):
@@ -130,7 +128,7 @@ class UniFiController:
@property
def option_ssid_filter(self):
"""Config entry option listing what SSIDs are being used to track clients."""
return self.config_entry.options.get(CONF_SSID_FILTER, DEFAULT_SSID_FILTER)
return self.config_entry.options.get(CONF_SSID_FILTER, [])
@property
def mac(self):