Capability report: PUT /devices/{id}/report, a Capabilities section, offline devices degraded

A device reports its board, screen, camera and ports from its own
credential (16 KB, schema 1, replacing the last report), and the flows
are validated against it again. The node panel turns a reported port's
config schema into a form, a reported screen is a canvas preset and a
touch screen's first report turns Touch friendly on. An offline device
node is degraded: amber on the canvas, a warning on Home, never a fault.
This commit is contained in:
Melvin Strobl
2026-10-16 17:37:49 +02:00
parent 1dc891aa1b
commit 4286acadfd
28 changed files with 820 additions and 129 deletions
@@ -85,7 +85,7 @@ type FlowEvent =
type: "node_health"
flow?: string
node: string
health: "ok" | "down" | "unknown"
health: "ok" | "degraded" | "down" | "unknown"
detail?: string | null
ts?: number
}
@@ -335,7 +335,9 @@ function open(url: string) {
// or a rebuild, never when health actually flipped. The store had a
// health map of its own and nothing ever read it.
invalidateHealth(message.flow)
if (message.health === "down") {
// Degraded is held back by the same floor, as a warning rather than
// a fault.
if (message.health === "down" || message.health === "degraded") {
// This fires at the transition, while the floor is still hiding the
// node, and the engine publishes nothing when the floor expires — so
// read again ourselves at that moment, or the issue waits for an
@@ -355,7 +357,11 @@ function open(url: string) {
type: message.type,
flow: message.flow,
node: message.node,
detail: message.detail ?? "Reported itself down.",
detail:
message.detail ??
(message.health === "down"
? "Reported itself down."
: "Reported itself degraded."),
ts: message.ts ?? Date.now() / 1000,
})
} else {