From bd4c14f31be75151f9ef0fb961d25c0b161096a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Fri, 2 Jun 2023 11:24:20 -0600 Subject: [PATCH] Update integrationUISP.py --- src/integrationUISP.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/integrationUISP.py b/src/integrationUISP.py index d88270ef..2db049dd 100644 --- a/src/integrationUISP.py +++ b/src/integrationUISP.py @@ -14,6 +14,10 @@ try: from ispConfig import airMax_capacity except: airMax_capacity = 0.65 +try: + from ispConfig import ltu_capacity +except: + ltu_capacity = 0.90 def uispRequest(target): # Sends an HTTP request to UISP and returns the @@ -143,13 +147,16 @@ def findApCapacities(devices, siteBandwidth): dlRatio = None if device['identification']['type'] == 'airMax': download, upload = airMaxCapacityCorrection(device, download, upload) - if (download < 15) or (upload < 15): - print("WARNING: Device '" + device['identification']['hostname'] + "' has unusually low capacity (" + str(download) + '/' + str(upload) + " Mbps). Discarding in favor of parent site rates.") - safeToUse = False + elif device['identification']['model'] == 'LTU-Rocket': + download = download * ltu_capacity + upload = upload * ltu_capacity if device['identification']['model'] == 'WaveAP': if (download < 500) or (upload < 500): download = 2450 upload = 2450 + if (download < 15) or (upload < 15): + print("WARNING: Device '" + device['identification']['hostname'] + "' has unusually low capacity (" + str(download) + '/' + str(upload) + " Mbps). Discarding in favor of parent site rates.") + safeToUse = False if safeToUse: siteBandwidth[device['identification']['name']] = { "download": download, "upload": upload}