From ded15aa6288930480b56db1bd46f82e431d6df42 Mon Sep 17 00:00:00 2001 From: Matthieu Houdebine Date: Wed, 11 Jun 2025 22:56:04 +0200 Subject: [PATCH] Update freebox.py: do not fail if unknown device type If a new device type has not been mapped yet, do not fail the scan but return "Unknown" instead --- front/plugins/freebox/freebox.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/front/plugins/freebox/freebox.py b/front/plugins/freebox/freebox.py index ee6b9fc0..1ce9488a 100755 --- a/front/plugins/freebox/freebox.py +++ b/front/plugins/freebox/freebox.py @@ -77,8 +77,12 @@ device_type_map = { def map_device_type(type: str): - return device_type_map[type] - + try: + return device_type_map[type] + except KeyError: + # This device type has not been mapped yet + mylog("minimal", [f"[{pluginName}] Unknown device type: {type}"]) + return device_type_map["other"] async def get_device_data(api_version: int, api_address: str, api_port: int): # ensure existence of db path