NSLOOKUP v0.1.8🚑

This commit is contained in:
Jokob-sk
2024-02-06 08:08:56 +11:00
parent f80d4eef4a
commit 50bcd8813a
3 changed files with 12 additions and 8 deletions

View File

@@ -37,8 +37,8 @@
"function": "RUN", "function": "RUN",
"events": ["run"], "events": ["run"],
"type": "text.select", "type": "text.select",
"default_value":"on_new_device", "default_value":"before_name_updates",
"options": ["disabled", "on_new_device", "once", "schedule", "always_after_scan"], "options": ["disabled", "before_name_updates", "on_new_device", "once", "schedule", "always_after_scan"],
"localized": ["name", "description"], "localized": ["name", "description"],
"name" :[{ "name" :[{
"language_code":"en_us", "language_code":"en_us",

View File

@@ -32,6 +32,7 @@ from database import DB
from reporting import get_notifications from reporting import get_notifications
from notification import Notification_obj from notification import Notification_obj
from plugin import run_plugin_scripts, check_and_run_user_event from plugin import run_plugin_scripts, check_and_run_user_event
from device import update_devices_names
#=============================================================================== #===============================================================================
@@ -135,8 +136,15 @@ def main ():
pluginsState.processScan = False pluginsState.processScan = False
process_scan(db) process_scan(db)
# --------
# Reporting # Reporting
# run plugins before notification processing (e.g. Plugins to discover device names)
pluginsState = run_plugin_scripts(db, 'before_name_updates', pluginsState)
# Resolve devices names
mylog('debug','[Main] Resolve devices names')
update_devices_names(db)
# Check if new devices found # Check if new devices found
sql.execute (sql_new_devices) sql.execute (sql_new_devices)
newDevices = sql.fetchall() newDevices = sql.fetchall()

View File

@@ -3,7 +3,7 @@
import conf import conf
from database import insertOnlineHistory from database import insertOnlineHistory
from device import create_new_devices, print_scan_stats, save_scanned_devices, update_devices_data_from_scan, update_devices_names from device import create_new_devices, print_scan_stats, save_scanned_devices, update_devices_data_from_scan
from helper import timeNowTZ from helper import timeNowTZ
from logger import mylog from logger import mylog
from reporting import skip_repeated_notifications from reporting import skip_repeated_notifications
@@ -40,10 +40,6 @@ def process_scan (db):
mylog('verbose','[Process Scan] Updating Devices Info') mylog('verbose','[Process Scan] Updating Devices Info')
update_devices_data_from_scan (db) update_devices_data_from_scan (db)
# Resolve devices names
mylog('verbose','[Process Scan] Resolve devices names')
update_devices_names(db)
# Void false connection - disconnections # Void false connection - disconnections
mylog('verbose','[Process Scan] Voiding false (ghost) disconnections') mylog('verbose','[Process Scan] Voiding false (ghost) disconnections')
void_ghost_disconnections (db) void_ghost_disconnections (db)