import { getNetworkType, bluetoothIsPowerOn, onDpDataChange, onDeviceOnlineStatusUpdate, onDeviceInfoUpdated, onNetworkStatusChange, onBluetoothAdapterStateChange, queryDps } from '@ray-js/ray'; import { PromisifyTTT, GetTTTEventListener, DevInfo, GetTTTSuccessData } from '../types'; import { LogConfig } from './utils'; import { ReadonlyDpSchemaList, InternalDpDataChangeParams, SmartDeviceModelAbility, SmartDeviceModelAbilities, GetSmartDeviceModelProps, GetSmartDeviceModelWatch, GetSmartDeviceModelActions, GetSmartDeviceModelDevInfo, GetSmartDeviceModelDpSchema, DeviceOnlineStatusUpdateParams, DeviceInfoUpdatedParams, NetworkStatusChangeParams, BluetoothAdapterStatusChangeParams, PublishDpsInterceptor, OnDpDataChangeInterceptor, OnDeviceOnlineStatusUpdateInterceptor, OnDeviceInfoUpdatedInterceptor, OnNetworkStatusChangeInterceptor, OnBluetoothAdapterStateChangeInterceptor, GetSmartDeviceDpCodes, InitDpStateInterceptor, InitDevInfoInterceptor } from './types'; import { publishDps } from '../kit'; /** * SmartDeviceModel 拦截器配置类型,供 dp-kit / matter-kit 组合使用。 * @internal */ export type SmartDeviceModelInterceptors = { /** * 设备模型初始化完毕触发的回调 * @typeOverride onInit (instance: SmartDeviceModel) => void */ onInit?: (instance: SmartDeviceModel) => void; /** * 设备模型初始化拦截器配置 */ init?: { /** * DP 状态转换拦截器,在以下时机被调用: * - 模型初始化时(action: 'init') * - dp 数据变化时(action: 'onDpDataChange' | 'dp-kit') * - 设备信息更新时(action: 'onDeviceInfoUpdated') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ initDpState?: InitDpStateInterceptor[]; /** * 设备信息转换拦截器,在以下时机被调用: * - 模型初始化时(action: 'init') * - 设备在线状态变化时(action: 'onDeviceOnlineStatusUpdate') * - 设备信息更新时(action: 'onDeviceInfoUpdated') * @default [logger] */ initDevInfo?: InitDevInfoInterceptor[]; }; /** * 请求拦截器配置 */ request?: { /** * 下发 DP 拦截器,在以下时机被调用: * - 下发 DP 时(action: 'publishDps') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ publishDps?: PublishDpsInterceptor[]; }; /** * 响应拦截器配置 */ response?: { /** * DP 数据变化拦截器,在以下时机被调用: * - dp 数据变化时(action: 'onDpDataChange') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ onDpDataChange?: OnDpDataChangeInterceptor[]; /** * 设备在线状态变化拦截器,在以下时机被调用: * - 设备在线状态变化时(action: 'onDeviceOnlineStatusUpdate') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ onDeviceOnlineStatusUpdate?: OnDeviceOnlineStatusUpdateInterceptor[]; /** * 设备信息更新拦截器,在以下时机被调用: * - 设备信息更新时(action: 'onDeviceInfoUpdated') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ onDeviceInfoUpdated?: OnDeviceInfoUpdatedInterceptor[]; /** * 网络状态变化拦截器,在以下时机被调用: * - 网络状态变化时(action: 'onNetworkStatusChange') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ onNetworkStatusChange?: OnNetworkStatusChangeInterceptor[]; /** * 蓝牙状态变化拦截器,在以下时机被调用: * - 蓝牙状态变化时(action: 'onBluetoothAdapterStateChange') * 拦截器接收完整的 dpState 和本次变更的 newDpState,返回处理后的 dpState * @default [logger] */ onBluetoothAdapterStateChange?: OnBluetoothAdapterStateChangeInterceptor[]; }; }; export type SmartDeviceModelOptions = { /** * 设备 ID,选填,默认从小程序环境启动参数自动获取 */ deviceId?: string; /** * @internal * 智能设备信息。 * 用于多设备环境下,通过批量接口提前获取到设备信息后直接注入,避免每个实例重复调用 getDeviceInfo 接口,提升初始化性能。 * * ⚠️ 仅供 SmartDevicesManager 内部在 batchAdd 时注入,业务侧请勿直接传入此字段。 */ devInfo?: DevInfo; /** * @internal * 全局网络状态,由 SmartDevicesManager 在 batchAdd 时统一获取后注入,避免每台设备重复请求。 * * ⚠️ 仅供 SmartDevicesManager 内部使用,业务侧请勿直接传入此字段。 */ network?: GetTTTSuccessData; /** * @internal * 全局蓝牙状态,由 SmartDevicesManager 在 batchAdd 时统一获取后注入,避免每台设备重复请求。 * * ⚠️ 仅供 SmartDevicesManager 内部使用,业务侧请勿直接传入此字段。 */ bluetooth?: GetTTTSuccessData; /** * @internal * 是否由 SmartDevicesManager 统一管理事件监听。 * - true: Manager 统一监听并注入事件(多设备场景,性能优化) * - false/undefined: 自行注册事件监听器(单设备场景,默认模式) * * ⚠️ 仅供 SmartDevicesManager 内部在 batchAdd 时设置,业务侧请勿直接传入此字段。 * * @default false */ managedByManager?: boolean; /** * 智能设备能力列表 */ abilities?: SmartDeviceModelAbilities; /** * @internal * 混入的设备模型列表 */ mixin?: SmartDeviceModel[]; /** * 日志配置 */ logConfig?: LogConfig; /** * 智能设备模型拦截器 * @unstable */ interceptors?: SmartDeviceModelInterceptors; }; declare const queryDpsAsync: PromisifyTTT; /** * 智能设备模型,提供设备功能点状态管理、事件监听、指令下发等核心能力 * @public * @since @ray-js/panel-sdk 1.0.0 * @typeParam S - 当前智能设备模型的 DpSchema 功能点描述定义 * @typeParam A - 当前智能设备模型的自定义高级能力定义 * @remarks * 所有 DP 相关 API 的类型均由泛型 S(ReadonlyDpSchemaList)在编译期推导, * S 来自业务项目 devices/schema.ts 中 as const 声明的 Schema 常量。 * * Schema property.type 与 TypeScript 类型映射: * - bool → boolean(true/false) * - value → number(受 property.min/max/step 运行时约束,类型仅为 number) * - enum → props 为 string;publishDps 入参为 property.range 字面量联合(如 'white' | 'colour') * - bitmap → number(位运算值,配合 actions 的 on(idx)/off(idx) 操作指定 bit 位) * - string → string * - raw(外层 type='raw')→ string * * Schema 必须使用 as const 断言,否则字面量类型推导退化。 * @param options - 设备模型初始化配置,包含 abilities(高级能力列表)和 interceptors(事件拦截器)等选项 * @example 基础初始化 * ```typescript * import { SmartDeviceModel } from '@ray-js/panel-sdk'; * import { defaultSchema } from './devices/schema'; * * type Schema = typeof defaultSchema; * const device = new SmartDeviceModel(); * await device.init(); * * // 初始化后即可访问设备状态 * const props = device.getDpState(); // { switch_led: boolean, work_mode: string, ... } * const devInfo = device.getDevInfo(); // 设备信息 * ``` */ export default class SmartDeviceModel { /** * 事件监听模式 * - 'self-registered': 自行注册事件监听器(单设备场景) * - 'managed': 由 SmartDevicesManager 统一管理(多设备场景) */ private _eventMode; /** * @param options - 设备模型初始化配置,包含 abilities(高级能力列表)和 interceptors(事件拦截器)等选项 */ constructor(options?: SmartDeviceModelOptions); /** * 异步初始化智能设备后再返回其实例 * @public * @since @ray-js/panel-sdk 1.0.0 * @param deviceId - 设备 ID,不传则从小程序环境启动参数自动获取 * @returns SmartDeviceModel 初始化完成的智能设备模型实例 * @typeOverride returns Promise * * @example 基础初始化 * ```typescript * import { SmartDeviceModel } from '@ray-js/panel-sdk'; * * const schema = [ * { code: 'switch_led', property: { type: 'bool' }, type: 'obj', mode: 'rw', id: 1, name: 'Switch' }, * { code: 'brightness', property: { type: 'value', min: 10, max: 1000, step: 1 }, type: 'obj', mode: 'rw', id: 2, name: 'Brightness' }, * ] as const; * * type Schema = typeof schema; * const device = new SmartDeviceModel(); * await device.init(); // 自动从小程序启动参数获取 deviceId * await device.init('your-device-id'); // 或指定 deviceId * ``` * @example 配置 abilities 和 dp-kit 拦截器 * ```typescript * import { SmartDeviceModel, SmartSupportAbility, createDpKit } from '@ray-js/panel-sdk'; * import { protocols } from './devices/protocols'; * * const dpKit = createDpKit({ * protocols, * sendDpOption: { immediate: true, throttle: 300 }, * }); * * const device = new SmartDeviceModel({ * abilities: [new SmartSupportAbility()], * interceptors: dpKit.interceptors, * }); * * await device.init(); * dpKit.init(device); * ``` */ init: (deviceId?: string) => Promise; /** * 初始化智能设备的标准高级能力 * @internal */ initAbilities: () => { syncAbilities: never[]; asyncAbilities: never[]; }; /** * 注册智能设备模型初始化完毕事件回调 * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 初始化完毕后触发的回调函数,接收当前设备实例作为参数 * @typeOverride listener (instance: SmartDeviceModel) => void * @returns 监听器 ID,用于通过 offInitialized 取消监听 * @example * ```typescript * const id = device.onInitialized((instance) => { * console.log('设备初始化完成', instance.getDevInfo().name); * }); * ``` */ onInitialized: (listener: (instance: SmartDeviceModel) => void) => number; /** * 取消智能设备模型初始化完毕事件监听 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onInitialized 返回的监听器 ID * @returns void * @example * ```typescript * const id = device.onInitialized(() => { console.log('已初始化'); }); * // 需要时取消监听 * device.offInitialized(id); * ``` */ offInitialized: (id: number) => void; /** * 初始化事件监听器自增索引 * @internal */ initializedIdx: number; /** * 初始化事件监听器集合 * @internal */ initializedListeners: Record) => void>; /** * 智能设备是否已初始化完毕 * @internal */ initialized: boolean; /** * 智能设备模型初始化配置 * @internal */ options: SmartDeviceModelOptions; /** * 获取智能设备信息,基于 ty.device.getDeviceInfo 实现 * @public * @since @ray-js/panel-sdk 1.0.0 * @returns 设备信息对象,包含 devId、name、schema、dps、isOnline、codeIds(Code→ID)、idCodes(ID→Code)等, * 注意与 ty.device.getDeviceInfo 返回值类型相比多了 codeIds 和 idCodes 字段, * 且群组环境下返回 GroupInfo,字段结构与 DeviceInfo 有差异 * @typeOverride returns DevInfo * @example * ```typescript * const devInfo = device.getDevInfo(); * console.log(devInfo.name); // 设备名称 * console.log(devInfo.isOnline); // 在线状态 * console.log(devInfo.codeIds.switch_led); // 20(Code→ID) * console.log(devInfo.idCodes[20]); // 'switch_led'(ID→Code) * ``` */ getDevInfo: () => GetSmartDeviceModelDevInfo; /** * 获取智能设备 DP Schema(功能点描述)映射表 * @public * @since @ray-js/panel-sdk 1.0.0 * @returns 功能点模型映射对象,key 为功能点 code,value 包含 attr、mode、property、type 等 * @typeOverride returns Record * @example * ```typescript * const dpSchema = device.getDpSchema(); * console.log(dpSchema.switch_led.property.type); // 'bool' * * // 返回值示例(key 为功能点 code): * // { * // power: { * // code: 'power', id: 1, name: '开关', mode: 'rw', type: 'obj', * // property: { type: 'bool' } * // }, * // mode: { * // code: 'mode', id: 3, name: '清扫模式', mode: 'rw', type: 'obj', * // property: { type: 'enum', range: ['standby', 'random', 'smart', 'wall_follow', ...] } * // } * // } * ``` */ getDpSchema: () => GetSmartDeviceModelDpSchema; /** * 获取智能设备功能点状态 * @public * @since @ray-js/panel-sdk 1.0.0 * @returns 全量功能点状态对象,key 为功能点 code,value 为功能点值,可能是 boolean、number、string * @typeOverride returns DpState * @example * ```typescript * const dpState = device.getDpState(); * console.log(dpState.switch_led); // true(boolean,对应 bool 类型 DP) * console.log(dpState.brightness); // 500(number,对应 value 类型 DP) * console.log(dpState.work_mode); // 'white'(string,对应 enum 类型 DP) * ``` */ getDpState: () => GetSmartDeviceModelProps; /** * 获取智能设备所处环境的网络状态 * @public * @since @ray-js/panel-sdk 1.0.0 * @returns 网络状态对象,包含 isConnected、networkType、signalStrength * @typeOverride returns NetworkState * @example * ```typescript * const network = device.getNetwork(); * console.log(network.isConnected); // true * console.log(network.networkType); // 'WIFI' * ``` */ getNetwork: () => import("../types").NetworkState; /** * 获取智能设备所处环境的蓝牙状态 * @public * @since @ray-js/panel-sdk 1.0.0 * @returns 蓝牙状态对象,包含 available(蓝牙是否可用) * @example * ```typescript * const bluetooth = device.getBluetooth(); * console.log(bluetooth.available); // true * ``` */ getBluetooth: () => { available: boolean; }; /** * 智能设备模型 * @internal * @deprecated 请使用 publishDps、getDpState 等 API 替代 */ model: { props: GetSmartDeviceModelProps; watch: GetSmartDeviceModelWatch; actions: GetSmartDeviceModelActions; abilities: A; }; /** * SDM 类标识 */ __flag__: symbol; /** * 智能设备信息,实际通过 devInfo 代理获取 */ private __devInfo__; /** * 智能设备 DP Schema(DP 功能点描述)映射表 */ private __dpSchema__; /** * 智能设备内部状态,实际通过 model.props 代理获取 */ private __dpState__; /** * 智能设备所处环境的网络状态,实际通过 network 代理获取 */ private __network__; /** * 智能设备所处环境的蓝牙状态,实际通过 bluetooth 代理获取 */ private __bluetooth__; /** * 智能设备内部内置的通用事件监听器 */ private __watches__; /** * 智能设备内部内置的 DP 事件监听器 */ private __dpWatches__; /** * 智能设备内置的事件监听器数量,持续递增 */ private __watchesCount__; /** * 智能设备模型拦截器 */ private __interceptors__; /** * 监听智能设备 DP 功能点变更事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 事件回调,接收包含 deviceId、dps(变更的功能点 ID→值映射)等信息的参数 * @returns 监听器 ID,用于通过 offDpDataChange 取消监听 * @example * ```typescript * const id = device.onDpDataChange((data) => { * console.log('DP 变更:', data.dps); * }); * // 取消监听 * device.offDpDataChange(id); * ``` */ onDpDataChange: (listener: GetTTTEventListener) => number; /** * 监听智能设备上下线状态变更 * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 事件回调,接收包含 deviceId、online 等信息的参数 * @returns 监听器 ID,用于通过 offDeviceOnlineStatusUpdate 取消监听 * @example * ```typescript * const id = device.onDeviceOnlineStatusUpdate((data) => { * console.log(data.deviceId, data.online ? '上线' : '离线'); * }); * ``` */ onDeviceOnlineStatusUpdate: (listener: GetTTTEventListener) => number; /** * 监听智能设备信息变更事件(包括设备名称、DP 名称等变更) * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 事件回调,接收包含 deviceId、变更数据等信息的参数 * @returns 监听器 ID,用于通过 offDeviceInfoUpdated 取消监听 * @example * ```typescript * const id = device.onDeviceInfoUpdated((data) => { * console.log('设备信息变更:', data.deviceId); * }); * // 取消监听 * device.offDeviceInfoUpdated(id); * ``` */ onDeviceInfoUpdated: (listener: GetTTTEventListener) => number; /** * 监听网络状态变化事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 事件回调,接收包含 isConnected、networkType 等信息的参数 * @returns 监听器 ID,用于通过 offNetworkStatusChange 取消监听 * @example * ```typescript * const id = device.onNetworkStatusChange((data) => { * console.log('网络状态变化:', data.isConnected, data.networkType); * }); * // 取消监听 * device.offNetworkStatusChange(id); * ``` */ onNetworkStatusChange: (listener: GetTTTEventListener) => number; /** * 监听蓝牙适配器状态变化事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param listener - 事件回调,接收包含 available 等信息的参数 * @returns 监听器 ID,用于通过 offBluetoothAdapterStateChange 取消监听 * @example * ```typescript * const id = device.onBluetoothAdapterStateChange((data) => { * console.log('蓝牙状态变化:', data.available ? '可用' : '不可用'); * }); * // 取消监听 * device.offBluetoothAdapterStateChange(id); * ``` */ onBluetoothAdapterStateChange: (listener: GetTTTEventListener) => number; /** * 取消监听智能设备 DP 功能点变更事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onDpDataChange 返回的监听器 ID * @returns void * @example * ```typescript * // 先注册监听 * const id = device.onDpDataChange((data) => { * console.log('DP 变更:', data.dps); * }); * // 需要时取消 * device.offDpDataChange(id); * ``` */ offDpDataChange: (id: number) => void; /** * 取消监听智能设备上下线状态变更 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onDeviceOnlineStatusUpdate 返回的监听器 ID * @returns void * @example * ```typescript * // 先注册监听 * const id = device.onDeviceOnlineStatusUpdate((data) => { * console.log(data.deviceId, data.online ? '上线' : '离线'); * }); * // 需要时取消 * device.offDeviceOnlineStatusUpdate(id); * ``` */ offDeviceOnlineStatusUpdate: (id: number) => void; /** * 取消监听智能设备信息变更事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onDeviceInfoUpdated 返回的监听器 ID * @returns void * @example * ```typescript * // 先注册监听 * const id = device.onDeviceInfoUpdated((data) => { * console.log('设备信息变更:', data.deviceId); * }); * // 需要时取消 * device.offDeviceInfoUpdated(id); * ``` */ offDeviceInfoUpdated: (id: number) => void; /** * 取消监听网络状态变化事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onNetworkStatusChange 返回的监听器 ID * @returns void * @example * ```typescript * // 先注册监听 * const id = device.onNetworkStatusChange((data) => { * console.log('网络状态变化:', data.isConnected, data.networkType); * }); * // 需要时取消 * device.offNetworkStatusChange(id); * ``` */ offNetworkStatusChange: (id: number) => void; /** * 取消监听蓝牙适配器状态变化事件 * @public * @since @ray-js/panel-sdk 1.0.0 * @param id - onBluetoothAdapterStateChange 返回的监听器 ID * @returns void * @example * ```typescript * // 先注册监听 * const id = device.onBluetoothAdapterStateChange((data) => { * console.log('蓝牙状态变化:', data.available ? '可用' : '不可用'); * }); * // 需要时取消 * device.offBluetoothAdapterStateChange(id); * ``` */ offBluetoothAdapterStateChange: (id: number) => void; /** * 批量控制智能设备 DP 功能点,基于 ty.device.publishDps 拓展实现 * @public * @since @ray-js/panel-sdk 1.6.0 * @param data - 要下发的功能点键值对。键为 DP Code,值类型需要根据设备的功能点 Schema 推导 * bool → boolean, value → number, enum → property.range 字面量联合, * bitmap → number, string/raw → string * @typeOverride data Record * @param options - 下发配置选项,其中 deviceId、dps 不再是必传参数,SendDpOption 类型为 dp-kit 拦截器提供的高阶配置 * @typeOverride options SendDpOption * @returns 是否下发成功 * @remarks * enum 类型的合法枚举值为 property.range 的字面量联合(如 'white' | 'colour')。 * value 类型的合法值为 property.min/max 范围内(自动 clamp)。 * @example 基础下发 * ```typescript * // 基于设备功能点 Schema 定义约束入参 * await device.publishDps({ switch_led: true }); // boolean * await device.publishDps({ work_mode: 'colour' }); // 'white' | 'colour'(IDE 自动提示) * await device.publishDps({ brightness: 500 }); // number(运行时 clamp 到 10~1000) * await device.publishDps({ switch_led: true, brightness: 800 }); // 支持批量下发 * ``` * @example dp-kit 拦截器高阶配置(需配合 createDpKit 使用) * ```typescript * // 立即更新本地状态(乐观更新,不等待设备上报) * await device.publishDps({ brightness: 800 }, { immediate: true }); * * // 节流 300ms,适用于滑动条等高频操作场景 * await device.publishDps({ brightness: 800 }, { throttle: 300 }); * * // 防抖 500ms,用户停止操作后才下发 * await device.publishDps({ brightness: 800 }, { debounce: 500 }); * * // 重复值不下发,避免无意义的指令 * await device.publishDps({ switch_led: true }, { checkRepeat: true }); * * // 忽略本次下发后的设备上报(防止滑动条回弹) * await device.publishDps({ brightness: 800 }, { ignoreDpDataResponse: true }); * * // 组合使用 * await device.publishDps( * { brightness: 800 }, * { immediate: true, throttle: 300, ignoreDpDataResponse: true }, * ); * ``` */ publishDps: (data: Partial>, options?: Parameters['1']) => Promise; /** * 主动查询设备功能点状态(不支持群组) * @public * @since @ray-js/panel-sdk 1.14.0 * @remarks queryType 参数说明: * - 3(默认): App 自动适配,需要 App >= 6.9.0 且容器 >= 3.32.0 * - 0: BLE 空指令查询 * - 1: 普通查询 * 低版本自动降级:BLE 单点设备在线时使用空指令查询(0),其他设备使用普通查询(1)。 * 如业务入参指定了 queryType,则优先使用指定值。 * @param params - 查询参数 * @typeOverride params { deviceId?: string; dpIds: number[]; queryType?: number; } * @returns 查询指令是否下发成功,不代表是否查询成功 * @example * ```typescript * const result = await device.queryDps({ dpIds: [1, 2, 3] }); * ``` */ queryDps: (params: Partial['0']>) => Promise; /** * 将当前智能设备与其他智能设备进行组合,合并 model.abilities 里的能力 * @internal * @since @ray-js/panel-sdk 1.0.0 * @param m - 要组合的其他智能设备模型实例数组 * @returns 组合后的智能设备模型实例 * @example * ```typescript * import { SmartDeviceModel } from '@ray-js/panel-sdk'; * * const mainDevice = new SmartDeviceModel(); * const subDevice = new SmartDeviceModel(); * * // 组合后,mainDevice 将拥有 subDevice 的 abilities * const composedDevice = mainDevice.compose([subDevice]); * ``` */ compose: >(m: SmartDeviceModel[]) => SmartDeviceModel; /** * 销毁当前智能设备实例,同时销毁所有事件监听器 * @public * @since @ray-js/panel-sdk 1.0.0 * @remarks * 销毁后实例不可再使用,所有通过 on* 系列方法注册的监听器均被移除。 * @example * ```typescript * device.destroy(); * ``` */ destroy: () => void; /** * 获取智能设备初始值 */ protected __initializeDeviceEnv__: (deviceId?: string) => Promise; /** * 给涉及的方法挂载上 interceptors */ private __withInterceptors__; /** * 给对应的方法挂载上拦截器 */ private __withInterceptor__; /** * 注册所有和智能设备有关联的事件 */ private __registerDeviceEventsHandler__; /** * 销毁所有和智能设备有关联的事件 */ private __unregisterDeviceEventsHandler__; private __publishDps__; private __initDpState__; private __initDevInfo__; /** * 智能设备 DP 状态变动处理器(带 deviceId 过滤,用于 self-registered 模式) */ private __dpDataChangeHandler__; /** * 处理 DP 数据变化的通用逻辑(不包含 deviceId 过滤) */ private __handleDpDataChange__; /** * 注入 DP 数据变化事件(供 SmartDevicesManager 调用) * @internal * @unstable */ __injectDpDataChange__(data: InternalDpDataChangeParams): void; /** * 智能设备上下线状态变更处理器(带 deviceId 过滤,用于 self-registered 模式) */ private __deviceOnlineStatusHandler__; /** * 处理设备上下线状态变更的通用逻辑 */ private __handleDeviceOnlineStatusUpdate__; /** * 注入设备上下线状态变更事件(供 SmartDevicesManager 调用) * @internal * @unstable */ __injectDeviceOnlineStatusUpdate__(data: DeviceOnlineStatusUpdateParams): void; /** * 设备 dp 名字和设备名字变更处理器(带 deviceId 过滤,用于 self-registered 模式) */ private __deviceInfoUpdateHandler__; /** * 处理设备信息更新的通用逻辑 */ private __handleDeviceInfoUpdated__; /** * 注入设备信息更新事件(供 SmartDevicesManager 调用) * @internal * @unstable */ __injectDeviceInfoUpdated__(data: DeviceInfoUpdatedParams): void; /** * 智能设备所处环境的网络状态变化处理器 */ private __networkStatusChangeHandler__; /** * 处理网络状态变化的通用逻辑 */ private __handleNetworkStatusChange__; /** * 注入网络状态变化事件(供 SmartDevicesManager 调用) * @internal * @unstable */ __injectNetworkStatusChange__(data: NetworkStatusChangeParams): void; /** * 智能设备所处环境的蓝牙适配器状态变化处理器 */ private __bluetoothAdapterStateChangeHandler__; /** * 处理蓝牙适配器状态变化的通用逻辑 */ private __handleBluetoothAdapterStateChange__; /** * 注入蓝牙适配器状态变化事件(供 SmartDevicesManager 调用) * @internal * @unstable */ __injectBluetoothAdapterStateChange__(data: BluetoothAdapterStatusChangeParams): void; } export {};