mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
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
This commit is contained in:
committed by
GitHub
parent
f4db748eae
commit
ded15aa628
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user