From d0545fe827b7bb1f2fc636e832947f61bf69978c Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Tue, 11 Mar 2025 09:00:12 -0400 Subject: [PATCH] Update ZHA device websocket API types (#24087) * Expose routing status from ZHA websocket API * Clean up types a little bit * Lint --- src/data/zha.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/data/zha.ts b/src/data/zha.ts index 8aa61c6f2c..c1204582bd 100644 --- a/src/data/zha.ts +++ b/src/data/zha.ts @@ -11,8 +11,8 @@ export interface ZHADevice { available: boolean; name: string; ieee: string; - nwk: string; - lqi: string; + nwk: number; + lqi: number; rssi: string; last_seen: string; manufacturer: string; @@ -29,6 +29,7 @@ export interface ZHADevice { active_coordinator: boolean; signature: any; neighbors: Neighbor[]; + routes: Route[]; pairing_status?: string; } @@ -40,6 +41,23 @@ export interface Neighbor { relationship: string; } +export interface Route { + dest_nwk: string; + route_status: RouteStatus; + memory_constrained: boolean; + many_to_one: boolean; + route_record_required: boolean; + next_hop: string; +} + +export enum RouteStatus { + Active = "Active", + DiscoveryUnderway = "Discovery_Underway", + DiscoveryFailed = "Discovery_Failed", + Inactive = "Inactive", + ValidationUnderway = "Validation_Underway", +} + export interface ZHADeviceEndpoint { device: ZHADevice; endpoint_id: number;