Skip to content

Commit

Permalink
🔌OMADA work #708
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jun 26, 2024
1 parent 6e78788 commit f065b83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion front/plugins/__template/rename_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def main():
# Retrieve configuration settings
some_setting = get_setting_value('SYNC_plugins')

mylog('verbose', [f'[{pluginName}] some_setting calue {some_setting}'])
mylog('verbose', [f'[{pluginName}] some_setting value {some_setting}'])

# retrieve data
device_data = get_device_data(some_setting)
Expand Down
14 changes: 7 additions & 7 deletions server/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_Vendor = "" OR dev_Vendor IS NULL)
(dev_Vendor IS NULL OR dev_Vendor IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
Expand All @@ -291,7 +291,7 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_Network_Node_port = "" OR dev_Network_Node_port IS NULL)
(dev_Network_Node_port IS NULL OR dev_Network_Node_port IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
Expand All @@ -307,14 +307,14 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_Network_Node_MAC_ADDR = "" OR dev_Network_Node_MAC_ADDR IS NULL)
(dev_Network_Node_MAC_ADDR IS NULL OR dev_Network_Node_MAC_ADDR IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
WHERE dev_MAC = cur_MAC
)""")

# Update only devices with empty or NULL dev_Network_Node_MAC_ADDR
# Update only devices with empty or NULL dev_NetworkSite
mylog('debug', '[Update Devices] - 3 cur_NetworkSite -> dev_NetworkSite')
sql.execute("""UPDATE Devices
SET dev_NetworkSite = (
Expand All @@ -323,7 +323,7 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_NetworkSite = "" OR dev_NetworkSite IS NULL)
(dev_NetworkSite IS NULL OR dev_NetworkSite IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
Expand All @@ -339,7 +339,7 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_SSID = "" OR dev_SSID IS NULL)
(dev_SSID IS NULL OR dev_SSID IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
Expand All @@ -355,7 +355,7 @@ def update_devices_data_from_scan (db):
WHERE dev_MAC = cur_MAC
)
WHERE
(dev_DeviceType = "" OR dev_DeviceType IS NULL)
(dev_DeviceType IS NULL OR dev_DeviceType IN ("", "null"))
AND EXISTS (
SELECT 1
FROM CurrentScan
Expand Down

0 comments on commit f065b83

Please sign in to comment.