From a7e4da55239a6bedf6d8b6b3974611bb0e44f632 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Sun, 13 Sep 2026 21:26:23 +0200 Subject: [PATCH] Update websocket exposed items --- custom_components/cookcli/websocket_api.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/custom_components/cookcli/websocket_api.py b/custom_components/cookcli/websocket_api.py index a85fc41..eaa3a82 100644 --- a/custom_components/cookcli/websocket_api.py +++ b/custom_components/cookcli/websocket_api.py @@ -43,14 +43,19 @@ async def ws_list_recipes( return coordinator = entry_data["coordinator"] - connection.send_result( - msg["id"], - { - "recipes": [ - {"path": r.path, "name": r.name} for r in coordinator.data or [] - ] - }, - ) + recipes = [] + for r in coordinator.data or []: + metadata = ((r.raw or {}).get("recipe") or {}).get("metadata") or {} + recipes.append( + { + "path": r.path, + "name": r.name, + "time": metadata.get("time"), + "servings": metadata.get("servings"), + "tags": metadata.get("tags", []), + } + ) + connection.send_result(msg["id"], {"recipes": recipes}) @websocket_api.websocket_command(