useDevices
useDevices(
query?): readonlyDevice[]
Defined in: console-sdk/src/react/hooks/useDevices.ts:131
The unified device list (SDK_PLAN.md §3.6.2). Returns every known device — saved, nearby, and connected as facets of ONE record — filtered by the optional DeviceQuery and ordered by the deterministic, STABLE fleet ordering (connected → saved-not-connected → discovered-only; never live-RSSI-sorted, so rows never reorder under the user’s finger). The no-query default is the full list.
The array identity is stable across renders whenever the projection is
unchanged, and the hook returns [] from the very first render (before
hydration or any sighting), so it is safe to map immediately (§3.9.1). Throws
OutsideProviderError when no <ConsoleProvider> is above the caller.
Parameters
Section titled “Parameters”query?
Section titled “query?”optional filter; omit for the full unified list.
Returns
Section titled “Returns”readonly Device[]
the filtered, fleet-ordered device list — referentially stable while its contents are unchanged.
Example
Section titled “Example”const devices = useDevices(); // full listconst machines = useDevices({ connected: true });