Gateway: include node caps + hardware in node.list

This commit is contained in:
Peter Steinberger
2025-12-18 00:12:02 +00:00
parent 99310a5bbb
commit 9f73131621
3 changed files with 73 additions and 11 deletions

View File

@@ -2965,17 +2965,20 @@ export async function startGatewayServer(port = 18789): Promise<GatewayServer> {
connected.map((n) => [n.nodeId, n]),
);
const nodes = list.paired.map((n) => {
const live = connectedById.get(n.nodeId);
return {
nodeId: n.nodeId,
displayName: live?.displayName ?? n.displayName,
platform: live?.platform ?? n.platform,
version: live?.version ?? n.version,
remoteIp: live?.remoteIp ?? n.remoteIp,
connected: Boolean(live),
};
});
const nodes = list.paired.map((n) => {
const live = connectedById.get(n.nodeId);
return {
nodeId: n.nodeId,
displayName: live?.displayName ?? n.displayName,
platform: live?.platform ?? n.platform,
version: live?.version ?? n.version,
deviceFamily: live?.deviceFamily ?? n.deviceFamily,
modelIdentifier: live?.modelIdentifier ?? n.modelIdentifier,
remoteIp: live?.remoteIp ?? n.remoteIp,
caps: live?.caps,
connected: Boolean(live),
};
});
respond(true, { ts: Date.now(), nodes }, undefined);
} catch (err) {