hilink-ts
Version:
智能家居hilink扩展h5应用工具开发
92 lines (91 loc) • 2.04 kB
TypeScript
import { HuaweiTimestamp } from "./time";
export interface IDevInfo {
devType: string;
fwv: string;
hiv: string;
hwv: string;
mac: string;
manu: string;
model: string;
prodId: string;
/**
* 协议类型。取值范围如下:
1: Wi-Fi。
2: Z-Wave。
3: ZigBee。
4: BLE。
5: PLC。
*/
protType: string;
setupType: string;
sn: string;
swv: string;
udid: string;
}
export interface IDevService<S, D> {
sid: S;
st: string;
reportId: string;
data?: D;
ts?: Date;
}
export type Bool = "true" | "false";
export interface IDevResult<S, D> {
/**
* 设备控制状态 。取值说明如下:
0:空闲。
1:控制中。
2:升级中。
*/
controlStatus: number;
/**
* 设备ID
*/
devId: string;
devInfo: IDevInfo;
devName: string;
devTags: {
sharable: Bool;
personal: Bool;
groupStatus: Bool;
};
deviceAliasNames: [];
deviceId: string;
deviceaddstatus: number;
gatewayId: string;
homeId: string;
homeName: string;
installationStatus: number;
isDeleted: boolean;
isLocalDevice: boolean;
isTitleOrNot: boolean;
/**
* 节点类型,取值范围如下:
ENDPOINT:通过网关接入的设备。
GATEWAY:网关。
GROUP:设备组。
*/
nodeType: string;
operations: ("READ" | "EXECUTE" | "WRITE")[];
prodId: string;
redPointFlag: number;
registryTime: HuaweiTimestamp;
role: string;
roomAliasNames: string[];
roomId: number;
roomName: string;
services: IDevService<S, D>[];
/**
* 设备状态。取值说明如下:
offline:设备离线。
online:设备在线。
inbox:未注册设备。
unConfigure: 海外未配置的路由
*/
status: string;
supportShare: boolean;
}
export interface ICacheDevResult<S, D> extends IDevResult<S, D> {
homeType: string;
from: string;
}