UniFi - Sites don't declare role on UniFiOS 1.7.0 beta (#35555)

* New way to identify role, compatible with standalone controller or as part of unifios

* Remove error

* Bump dependency to v22

* Remove unused import
This commit is contained in:
Robert Svensson authored and GitHub committed 2020-05-13 00:37:16 +02:00
1 parent eddb5c6c3f
commit 785b8d2bd1
10 files changed
+16 -71

No files matched your search

@@ -66,6 +66,7 @@ ENTRY_OPTIONS = {}
CONFIGURATION = []
SITES = {"Site name": {"desc": "Site name", "name": "site_id", "role": "admin"}}
DESCRIPTION = [{"name": "username", "site_name": "site_id", "site_role": "admin"}]
async def setup_unifi_integration(
@@ -73,6 +74,7 @@ async def setup_unifi_integration(
config=ENTRY_CONFIG,
options=ENTRY_OPTIONS,
sites=SITES,
site_description=DESCRIPTION,
clients_response=None,
devices_response=None,
clients_all_response=None,
@@ -130,6 +132,8 @@ async def setup_unifi_integration(
with patch("aiounifi.Controller.check_unifi_os", return_value=True), patch(
"aiounifi.Controller.login", return_value=True,
), patch("aiounifi.Controller.sites", return_value=sites), patch(
"aiounifi.Controller.site_description", return_value=site_description
), patch(
"aiounifi.Controller.request", new=mock_request
), patch.object(
aiounifi.websocket.WSClient, "start", return_value=True