import { BroadcastAddress } from "../../zspec/enums"; import * as Zcl from "../../zspec/zcl"; import type { TFoundation } from "../../zspec/zcl/definition/clusters-types"; import type { FoundationDefinition } from "../../zspec/zcl/definition/foundation"; import type * as ZclTypes from "../../zspec/zcl/definition/tstype"; import type { ClusterOrRawAttributeKeys, ClusterOrRawAttributes, ClusterOrRawPayload, FoundationOrRawPayload, KeyValue, PartialClusterOrRawWriteAttributes, SendPolicy, TCustomCluster } from "../tstype"; import Device from "./device"; import Group from "./group"; import { ZigbeeEntity } from "./zigbeeEntity"; export interface ConfigureReportingItem { attribute: ClusterOrRawAttributeKeys[number] | { ID: number; type: number; }; minimumReportInterval: number; maximumReportInterval: number; reportableChange?: number; } export interface ReadReportConfigItem { direction?: Zcl.Direction; attribute: ClusterOrRawAttributeKeys[number] | { ID: number; }; } interface Options { manufacturerCode?: number; disableDefaultResponse?: boolean; disableResponse?: boolean; timeout?: number; direction?: Zcl.Direction; srcEndpoint?: number; profileId?: number; reservedBits?: number; transactionSequenceNumber?: number; disableRecovery?: boolean; writeUndiv?: boolean; sendPolicy?: SendPolicy; } export interface Clusters { [cluster: string]: { attributes: { [attribute: string]: number | string; }; }; } export interface BindInternal { cluster: number; type: "endpoint" | "group"; deviceIeeeAddress?: string; endpointID?: number; groupID?: number; } interface Bind { cluster: ZclTypes.Cluster; target: Endpoint | Group; } interface ConfiguredReporting { cluster: ZclTypes.Cluster; attribute: ZclTypes.Attribute; minimumReportInterval: number; maximumReportInterval: number; reportableChange: number; } export declare class Endpoint extends ZigbeeEntity { deviceID?: number; inputClusters: number[]; outputClusters: number[]; profileID?: number; readonly ID: number; readonly clusters: Clusters; deviceIeeeAddress: string; deviceNetworkAddress: number; private _binds; private _configuredReportings; meta: KeyValue; private pendingRequests; get binds(): Bind[]; get configuredReportings(): ConfiguredReporting[]; private constructor(); /** * Get device of this endpoint */ getDevice(): Device; /** * @param {number|string} clusterKey * @returns {boolean} */ supportsInputCluster(clusterKey: number | string): boolean; /** * @param {number|string} clusterKey * @returns {boolean} */ supportsOutputCluster(clusterKey: number | string): boolean; /** * @returns {ZclTypes.Cluster[]} */ getInputClusters(): ZclTypes.Cluster[]; /** * @returns {ZclTypes.Cluster[]} */ getOutputClusters(): ZclTypes.Cluster[]; static fromDatabaseRecord(record: KeyValue, deviceNetworkAddress: number, deviceIeeeAddress: string): Endpoint; toDatabaseRecord(): KeyValue; static create(id: number, profileID: number | undefined, deviceID: number | undefined, inputClusters: number[], outputClusters: number[], deviceNetworkAddress: number, deviceIeeeAddress: string): Endpoint; saveClusterAttributeKeyValue(clusterKey: number | string, list: KeyValue): void; getClusterAttributeValue(clusterKey: number | string, attributeKey: number | string): number | string | undefined; saveClusterAttributeReportConfig(clusterId: number, manufacturerCode: Zcl.ManufacturerCode | undefined, reportConfigs: TFoundation["readReportConfigRsp"]): void; saveBindings(binds: BindInternal[]): void; clearBindings(): void; hasPendingRequests(): boolean; sendPendingRequests(fastPolling: boolean): Promise; private sendRequest; private checkStatus; report(clusterKey: Cl, attributes: PartialClusterOrRawWriteAttributes, options?: Options): Promise; write(clusterKey: Cl, attributes: PartialClusterOrRawWriteAttributes, options?: Options): Promise; writeResponse(clusterKey: Cl, transactionSequenceNumber: number, attributes: Partial[number], TFoundation["writeRsp"][number]>> & Record, options?: Options): Promise; read(clusterKey: Cl, attributes: ClusterOrRawAttributeKeys, options?: Options): Promise>; /** * Sends a Foundation response to a read request. * Any attribute with an `undefined` value will result in a sent record with status `UNSUPPORTED_ATTRIBUTE` */ readResponse(clusterKey: Cl, transactionSequenceNumber: number, attributes: PartialClusterOrRawWriteAttributes, options?: Options): Promise; updateSimpleDescriptor(): Promise; hasBind(clusterId: number, target: Endpoint | Group): boolean; getBindIndex(clusterId: number, target: Endpoint | Group): number; addBinding(clusterKey: number | string, target: Endpoint | Group | number): void; private addBindingInternal; bind(clusterKey: number | string, target: Endpoint | Group | number): Promise; save(): void; unbind(clusterKey: number | string, target: Endpoint | Group | number, force?: boolean): Promise; defaultResponse(commandID: number, status: number, clusterID: number, transactionSequenceNumber: number, options?: Options): Promise; configureReporting(clusterKey: Cl, items: ConfigureReportingItem[], options?: Options): Promise; readReportingConfig(clusterKey: Cl, items: ReadReportConfigItem[], options?: Options): Promise; writeStructured(clusterKey: Cl, payload: TFoundation["writeStructured"], options?: Options): Promise; command(clusterKey: Cl, commandKey: Co, payload: ClusterOrRawPayload, options?: Options): Promise; commandResponse(clusterKey: Cl, commandKey: Co, payload: ClusterOrRawPayload, options?: Options, transactionSequenceNumber?: number): Promise; private getOptionsWithDefaults; private ensureManufacturerCodeIsUniqueAndGet; addToGroup(group: Group): Promise; private getCluster; /** * Remove endpoint from a group, accepts both a Group and number as parameter. * The number parameter type should only be used when removing from a group which is not known * to zigbee-herdsman. */ removeFromGroup(group: Group | number): Promise; removeFromAllGroups(): Promise; removeFromAllGroupsDatabase(): void; zclCommand(clusterKey: Cl | ZclTypes.Cluster, commandKey: Co | ZclTypes.Command | FoundationDefinition, payload: ClusterOrRawPayload | FoundationOrRawPayload, options?: Options, logPayload?: KeyValue, checkStatus?: boolean, frameType?: Zcl.FrameType): Promise; zclCommandBroadcast(endpoint: number, destination: BroadcastAddress, clusterKey: Cl, commandKey: Co, payload: ClusterOrRawPayload | FoundationOrRawPayload, options?: Options): Promise; } export default Endpoint; //# sourceMappingURL=endpoint.d.ts.map