Update websocket exposed items

This commit is contained in:
TheThomaas 2026-09-13 21:26:23 +02:00
parent 53fc14dbef
commit a7e4da5523

View file

@ -43,14 +43,19 @@ async def ws_list_recipes(
return return
coordinator = entry_data["coordinator"] coordinator = entry_data["coordinator"]
connection.send_result( recipes = []
msg["id"], for r in coordinator.data or []:
{ metadata = ((r.raw or {}).get("recipe") or {}).get("metadata") or {}
"recipes": [ recipes.append(
{"path": r.path, "name": r.name} for r in coordinator.data or [] {
] "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( @websocket_api.websocket_command(