Skip to content

Commit

Permalink
Use switch_site for older versions (#17)
Browse files Browse the repository at this point in the history
* use switchsite for older versions
  • Loading branch information
peterbaumert authored Jan 5, 2022
1 parent a520405 commit 555b536
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions unifi_respondd/unifi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,18 @@ def get_infos():
geolookup = Nominatim(user_agent="ffmuc_respondd")
aps = Accesspoints(accesspoints=[])
for site in c.get_sites():
c = Controller(
host=cfg.controller_url,
username=cfg.username,
password=cfg.password,
port=cfg.controller_port,
version=cfg.version,
site_id=site["name"],
ssl_verify=cfg.ssl_verify,
)
if cfg.version == "UDMP-unifiOS":
c = Controller(
host=cfg.controller_url,
username=cfg.username,
password=cfg.password,
port=cfg.controller_port,
version=cfg.version,
site_id=site["name"],
ssl_verify=cfg.ssl_verify,
)
else:
c.switch_site(site["desc"])
aps_for_site = c.get_aps()
clients = c.get_clients()
for ap in aps_for_site:
Expand Down

0 comments on commit 555b536

Please sign in to comment.