UniFi - Make POE control switches configurable (#32781)

* Allow control whether POE switches are to be created or not

* Fix options flow and test
This commit is contained in:
Robert Svensson
2020-04-02 17:53:33 +02:00
committed by GitHub
parent 23e091696e
commit 314bc07cee
7 changed files with 76 additions and 45 deletions

View File

@@ -24,6 +24,7 @@ from .const import (
CONF_BLOCK_CLIENT,
CONF_CONTROLLER,
CONF_DETECTION_TIME,
CONF_POE_CLIENTS,
CONF_SITE_ID,
CONF_SSID_FILTER,
CONF_TRACK_CLIENTS,
@@ -32,6 +33,7 @@ from .const import (
CONTROLLER_ID,
DEFAULT_ALLOW_BANDWIDTH_SENSORS,
DEFAULT_DETECTION_TIME,
DEFAULT_POE_CLIENTS,
DEFAULT_TRACK_CLIENTS,
DEFAULT_TRACK_DEVICES,
DEFAULT_TRACK_WIRED_CLIENTS,
@@ -98,6 +100,11 @@ class UniFiController:
"""Config entry option with list of clients to control network access."""
return self.config_entry.options.get(CONF_BLOCK_CLIENT, [])
@property
def option_poe_clients(self):
"""Config entry option to control poe clients."""
return self.config_entry.options.get(CONF_POE_CLIENTS, DEFAULT_POE_CLIENTS)
@property
def option_track_clients(self):
"""Config entry option to not track clients."""