UniFi config option SSID filter (#31842)

* Draft

* Use new multi_select config validation

* Bump dependency to v13

* Improve options flow

* Add title to config options

* Add config option descriptions

* Fix martins comment
This commit is contained in:
Robert Svensson 2020-02-18 23:24:21 +01:00 committed by GitHub
parent 60ae85564e
commit 774c892ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 84 additions and 62 deletions

View file

@ -63,6 +63,7 @@ async def setup_unifi_integration(
clients_response=None,
devices_response=None,
clients_all_response=None,
wlans_response=None,
known_wireless_clients=None,
controllers=None,
):
@ -98,6 +99,10 @@ async def setup_unifi_integration(
if clients_all_response:
mock_client_all_responses.append(clients_all_response)
mock_wlans_responses = deque()
if wlans_response:
mock_wlans_responses.append(wlans_response)
mock_requests = []
async def mock_request(self, method, path, json=None):
@ -109,6 +114,8 @@ async def setup_unifi_integration(
return mock_device_responses.popleft()
if path == "s/{site}/rest/user" and mock_client_all_responses:
return mock_client_all_responses.popleft()
if path == "s/{site}/rest/wlanconf" and mock_wlans_responses:
return mock_wlans_responses.popleft()
return {}
# "aiounifi.Controller.start_websocket", return_value=True
@ -128,6 +135,7 @@ async def setup_unifi_integration(
controller.mock_client_responses = mock_client_responses
controller.mock_device_responses = mock_device_responses
controller.mock_client_all_responses = mock_client_all_responses
controller.mock_wlans_responses = mock_wlans_responses
controller.mock_requests = mock_requests
return controller