Skip to content

Commit

Permalink
Merge pull request #16 from ingoldsby/patch-1
Browse files Browse the repository at this point in the history
Use 'radio' name to designate bands for ssids instead of channels
  • Loading branch information
w1tw0lf authored Jan 31, 2025
2 parents 6bbc9cb + efe5b47 commit 558fdf7
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions unifi_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@
# Add additional attributes for access points
elif device_type == 'uap':
vapTable = pd.DataFrame(devs.get('vap_table'))
# get ssid's that are on channels 1 to 13 = 2.4Ghz
# get ssid's that are on channels 36 to 165 = 5Ghz
# get ssid's that are radio variable 'ng' = 2.4Ghz
# get ssid's that are radio variable 'na' = 5Ghz
# get ssid's that are radio variable '6e' = 6Ghz

ghz2_4 = vapTable[vapTable['channel'].between(0,13)].reset_index(inplace = False, drop = True)
ghz5 = vapTable[vapTable['channel'].between(36,165)].reset_index(inplace = False, drop = True)
ghz2_4 = vapTable[(vapTable['radio'] == 'ng')]
ghz5 = vapTable[(vapTable['radio'] == 'na')]
ghz6 = vapTable[(vapTable['radio'] == '6e')]

radio_24ghz = {}

Expand Down Expand Up @@ -131,6 +133,19 @@
"guest": row['is_guest']
}

radio_6ghz = {}

for index, row in ghz6.iterrows():
radio_6ghz[f"ssid{index}"] = {
"ssid": row['essid'],
"channel": row['channel'],
"number_connected": row['num_sta'],
"satisfaction": 0 if row['satisfaction'] == -1 else row['satisfaction'],
"bytes_rx": row['rx_bytes'],
"bytes_tx": row['tx_bytes'],
"guest": row['is_guest']
}

radio_table_stats = devs.get('radio_table_stats', [])
radio_clients = {}
radio_scores = {}
Expand All @@ -147,6 +162,7 @@
**radio_scores,
"ssids_24ghz": radio_24ghz,
"ssids_5ghz": radio_5ghz,
"ssids_6ghz": radio_6ghz,
})

# Add additional attributes for UDM SE
Expand Down

0 comments on commit 558fdf7

Please sign in to comment.