Update websocket exposed items
This commit is contained in:
parent
53fc14dbef
commit
a7e4da5523
|
|
@ -43,14 +43,19 @@ async def ws_list_recipes(
|
|||
return
|
||||
|
||||
coordinator = entry_data["coordinator"]
|
||||
connection.send_result(
|
||||
msg["id"],
|
||||
recipes = []
|
||||
for r in coordinator.data or []:
|
||||
metadata = ((r.raw or {}).get("recipe") or {}).get("metadata") or {}
|
||||
recipes.append(
|
||||
{
|
||||
"recipes": [
|
||||
{"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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue