import { JSONSchema7 } from "json-schema"; import { SimulationLinkDatum, SimulationNodeDatum } from "d3-force"; export declare type DeviceType = "EndDevice" | "Router" | "Coordinator"; export declare type FriendlyName = string; export declare type IEEEEAddress = string; export declare type OTAState = { state: "available" | "updating"; progress: number; remaining: number; }; export declare type RGBColor = { r: number; g: number; b: number; }; export declare type HueSaturationColor = { hue: number; saturation: number; }; export declare type XYColor = { x: number; y: number; }; export declare type AnyColor = RGBColor | XYColor | HueSaturationColor; export declare type DeviceState = Record; export declare type Cluster = string | number; export declare type Attribute = string; export declare type Endpoint = string | number; export interface Meta { revision: number; transportrev: number; product: number; majorrel: number; minorrel: number; maintrel: number; } export interface Coordinator { type: string; meta: Meta; } export interface Network { channel: number; pan_id: number; extended_pan_id: number[]; } export declare type DeviceConfig = Record; export interface AdvancedConfig { elapsed: boolean; last_seen: "disable" | "ISO_8601" | "ISO_8601_local" | "epoch"; legacy_api: boolean; } export interface Z2MConfig { homeassistant: boolean; advanced: AdvancedConfig; devices: Record; device_options: DeviceConfig; [k: string]: unknown; } export interface BridgeConfig { version: string; commit: string; coordinator: Coordinator; network: Network; log_level: string; permit_join: boolean; } export declare type BridgeState = "online" | "offline"; export interface BridgeInfo { config: Z2MConfig; config_schema: JSONSchema7; permit_join: boolean; permit_join_timeout: number; commit?: string; version?: string; coordinator?: { meta?: { revision?: string; }; type?: string; ieee_address: string; }; device_options: Record; restart_required: boolean; } export declare type PowerSource = "Battery" | "Mains (single phase)" | "DC Source"; export declare type GenericFeatureType = "numeric" | "binary" | "enum" | "text" | "list"; export declare type CompositeFeatureType = "fan" | "light" | "switch" | "cover" | "lock" | "composite" | "climate"; export declare enum FeatureAccessMode { NONE = 0, ACCESS_STATE = 1, ACCESS_WRITE = 2, ACCESS_READ = 4 } export interface GenericExposedFeature { type: GenericFeatureType; name: string; unit?: "string"; access: FeatureAccessMode; endpoint?: Endpoint; property: string; description?: string; } export interface BinaryFeature extends GenericExposedFeature { type: "binary"; value_on: unknown; value_off: unknown; value_toggle?: unknown; } export interface ListFeature extends GenericExposedFeature { type: "list"; item_type: "number" | GenericOrCompositeFeature; length_min?: number; length_max?: number; } export interface CompositeFeature extends Omit { type: CompositeFeatureType; features: GenericOrCompositeFeature[]; } export declare type GenericOrCompositeFeature = GenericExposedFeature | CompositeFeature; export interface NumericFeaturePreset { name: string; value: number; description?: string; } export interface NumericFeature extends GenericExposedFeature { type: "numeric"; value_min?: number; value_max?: number; value_step?: number; presets?: NumericFeaturePreset[]; } export interface TextualFeature extends GenericExposedFeature { type: "text"; } export interface EnumFeature extends GenericExposedFeature { type: "enum"; values: unknown[]; } export interface GradientFeature extends GenericExposedFeature { type: "text"; name: "gradient"; } export interface LightFeature extends CompositeFeature { type: "light"; } export interface SwitchFeature extends CompositeFeature { type: "switch"; } export interface CoverFeature extends CompositeFeature { type: "cover"; } export interface LockFeature extends CompositeFeature { type: "lock"; } export interface FanFeature extends CompositeFeature { type: "fan"; } export interface ClimateFeature extends CompositeFeature { type: "climate"; } export interface ColorFeature extends CompositeFeature { type: "composite"; name: "color_xy" | "color_hs"; features: NumericFeature[]; } export interface DeviceDefinition { description: string; model: string; supports: string; vendor: string; exposes: GenericOrCompositeFeature[]; options: GenericOrCompositeFeature[]; supports_ota: boolean; icon?: string; } export interface ReportingConfig { cluster: Cluster; attribute: Attribute; maximum_report_interval: number; minimum_report_interval: number; reportable_change: number; } export interface WithScenes { scenes?: Scene[]; } export interface EndpointDescription extends WithScenes { bindings: BindRule[]; configured_reportings: ReportingConfig[]; clusters: { input: Cluster[]; output: Cluster[]; }; } export interface WithDescription { description: string; } export interface WithFriendlyName { friendly_name: FriendlyName; } export interface GroupAddress { endpoint: Endpoint; ieee_address: IEEEEAddress; } export declare type Scene = { id: number; name?: string; endpoint?: Endpoint; }; export interface Group extends WithFriendlyName, WithDescription, WithScenes { id: number; members: GroupAddress[]; } export interface Device extends WithFriendlyName, WithDescription { ieee_address: IEEEEAddress; type: DeviceType; network_address: number; power_source?: PowerSource; model_id: string; manufacturer: string; interviewing: boolean; interview_completed: boolean; software_build_id: number; supported: boolean; definition?: DeviceDefinition; date_code: string; endpoints: Record; } export declare type ObjectType = "device" | "group"; export interface BindRule { cluster: Cluster; target: { id?: number; endpoint?: Endpoint; ieee_address?: IEEEEAddress; type: "endpoint" | "group"; }; } export interface TouchLinkDevice { ieee_address: IEEEEAddress; channel: number; } export declare type LastSeenType = "disable" | "ISO_8601" | "ISO_8601_local" | "epoch"; export declare type KVP = Record; export declare type Prev = [ never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...0[] ]; export declare type Join = K extends string | number ? P extends string | number ? `${K}${"" extends P ? "" : "."}${P}` : never : never; export declare type Paths = [D] extends [never] ? never : T extends object ? { [K in keyof T]-?: K extends string | number ? `${K}` | Join> : never; }[keyof T] : ""; export declare type Leaves = [D] extends [never] ? never : T extends object ? { [K in keyof T]-?: Join>; }[keyof T] : ""; export interface NodeI extends SimulationNodeDatum { ieeeAddr: string; friendlyName?: string; type: DeviceType; lastSeen?: number; definition?: DeviceDefinition; } export declare type LinkType = "Coordinator2EndDevice" | "EndDevice2Coordinator" | "Coordinator2Router" | "Router2Coordinator" | "EndDevice2Router" | "Router2EndDevice" | "Router2Router" | "BrokenLink"; export declare enum ZigbeeRelationship { NeigbhorIsParent = 0, NeigbhorIsAChild = 1, NeigbhorIsASibling = 2, NoneOfTheAbove = 3, NeigbhorIsAFormerChild = 4 } export interface LinkI extends SimulationLinkDatum { source: NodeI; target: NodeI; linkquality: number; linkqualities: number[]; depth: number; routes: unknown[]; lqi: number; relationship: ZigbeeRelationship; relationships: ZigbeeRelationship[]; linkType: LinkType; } export interface GraphI { nodes: NodeI[]; links: LinkI[]; } //# sourceMappingURL=types.d.ts.map