From 2025c0a7bbe02a5ee2f6f2cf54e33ddc386c3d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Chac=C3=B3n?= Date: Thu, 10 Mar 2022 16:18:46 -0700 Subject: [PATCH] Update LibreQoS.py --- v1.0/LibreQoS.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v1.0/LibreQoS.py b/v1.0/LibreQoS.py index 693eb7b5..badbcca7 100644 --- a/v1.0/LibreQoS.py +++ b/v1.0/LibreQoS.py @@ -107,6 +107,12 @@ def refreshShapers(): devicesForThisAP.append(device) accessPoints.append((APname, apDownload, apUpload, parentSite, devicesForThisAP)) + # Sort devices into bins by AP, for scenario shapeBySite = False + result = collections.defaultdict(list) + for d in devices: + result[d['AP']].append(d) + devicesByAP = list(result.values()) + # If an AP is specified for a device in Shaper.csv, but AP is not listed in AccessPoints.csv, raise exception for device in devices: if (device['AP'] not in accessPointNamesOnly):