diff --git a/front/plugins/freebox/freebox.py b/front/plugins/freebox/freebox.py index a31fe10c..02bdc7f6 100755 --- a/front/plugins/freebox/freebox.py +++ b/front/plugins/freebox/freebox.py @@ -107,10 +107,10 @@ async def get_device_data(api_version: int, api_address: str, api_port: int): await fbx.open(host=api_address, port=str(api_port)) except NotOpenError as e: mylog("verbose", [f"[{pluginName}] Error connecting to freebox: {e}"]) - return (),() + return None, [] except AuthorizationError as e: mylog("verbose", [f"[{pluginName}] Auth error: {str(e)}"]) - return (),() + return None, [] # get also info of the freebox itself config = await cast(System, fbx.system).get_config() @@ -147,16 +147,17 @@ def main(): mylog("verbose", [freebox]) mylog("verbose", [hosts]) - plugin_objects.add_object( - primaryId=freebox["mac"], # type: ignore - secondaryId=freebox["ip"], # type: ignore - watched1=freebox["name"], # type: ignore - watched2=freebox["operator"], # type: ignore - watched3="Gateway", - watched4=timeNowUTC(), - extra="", - foreignKey=freebox["mac"], # type: ignore - ) + if freebox: + plugin_objects.add_object( + primaryId=freebox["mac"], + secondaryId=freebox["ip"], + watched1=freebox["name"], + watched2=freebox["operator"], + watched3="Gateway", + watched4=timeNowUTC(), + extra="", + foreignKey=freebox["mac"], + ) for host in hosts: # Check if 'l3connectivities' exists and is a list if "l3connectivities" in host and isinstance(host["l3connectivities"], list): diff --git a/install/proxmox/requirements.txt b/install/proxmox/requirements.txt index 6948ea66..2c858b95 100755 --- a/install/proxmox/requirements.txt +++ b/install/proxmox/requirements.txt @@ -24,4 +24,4 @@ librouteros yattag zeroconf psutil -git+https://github.com/foreign-sub/aiofreepybox.git +freebox-api diff --git a/install/ubuntu24/requirements.txt b/install/ubuntu24/requirements.txt index 6948ea66..2c858b95 100755 --- a/install/ubuntu24/requirements.txt +++ b/install/ubuntu24/requirements.txt @@ -24,4 +24,4 @@ librouteros yattag zeroconf psutil -git+https://github.com/foreign-sub/aiofreepybox.git +freebox-api