From 7085683c66b66f067c288e9738a9851c9b7b48da Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 29 May 2024 12:36:42 +1200 Subject: [PATCH] add api to fetch reticulum interfaces --- web.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web.py b/web.py index fdc7621..cf9d03b 100644 --- a/web.py +++ b/web.py @@ -154,6 +154,18 @@ class ReticulumWebChat: "comports": comports, }) + # fetch reticulum interfaces + @routes.get("/api/v1/reticulum/interfaces") + async def index(request): + + interfaces = {} + if "interfaces" in self.reticulum.config: + interfaces = self.reticulum.config["interfaces"] + + return web.json_response({ + "interfaces": interfaces, + }) + # handle websocket clients @routes.get("/ws") async def ws(request):