mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-07 02:31:27 -07:00
The fritzconnection imports were originally placed inside the function bodies as a defensive pattern: by catching ImportError locally, get_fritzbox_connection() and get_connected_devices() could each return None or an empty list with a user-friendly log message instead of crashing at import time. This kept the plugin runnable even when the dependency was missing. Requested by reviewer jokob-sk in PR #1592: move all imports to the top of the module, treating fritzconnection as a required dependency that is assumed to be installed via requirements.txt. Changes: - Add top-level imports for FritzConnection and FritzHosts (fritzbox.py:16-17) - Remove inline import and ImportError handler from get_fritzbox_connection() (fritzbox.py:48, 64-67) - Remove inline import and ImportError handler from get_connected_devices() (fritzbox.py:79, 133-134) Functional behavior of the plugin is unchanged.
9.5 KiB
Executable File
9.5 KiB
Executable File