Add interfaces package
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
export type TDeviceProtocol =
|
||||
| 'matter'
|
||||
| 'zigbee'
|
||||
| 'zwave'
|
||||
| 'thread'
|
||||
| 'mqtt'
|
||||
| 'homekit'
|
||||
| 'esphome'
|
||||
| 'homeassistant'
|
||||
| 'hue'
|
||||
| 'http'
|
||||
| 'cloud'
|
||||
| 'virtual'
|
||||
| 'unknown';
|
||||
|
||||
export type TDeviceCapability =
|
||||
| 'switch'
|
||||
| 'sensor'
|
||||
| 'light'
|
||||
| 'cover'
|
||||
| 'lock'
|
||||
| 'fan'
|
||||
| 'climate'
|
||||
| 'camera'
|
||||
| 'media'
|
||||
| 'energy'
|
||||
| 'notification';
|
||||
|
||||
export type TDeviceStateValue = string | number | boolean | null | Record<string, unknown>;
|
||||
|
||||
export interface IDeviceFeature {
|
||||
id: string;
|
||||
capability: TDeviceCapability;
|
||||
name: string;
|
||||
readable: boolean;
|
||||
writable: boolean;
|
||||
unit?: string;
|
||||
}
|
||||
|
||||
export interface IDeviceState {
|
||||
featureId: string;
|
||||
value: TDeviceStateValue;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface IDeviceDefinition {
|
||||
id: string;
|
||||
integrationDomain?: string;
|
||||
name: string;
|
||||
room?: string;
|
||||
protocol: TDeviceProtocol;
|
||||
manufacturer?: string;
|
||||
model?: string;
|
||||
online: boolean;
|
||||
features: IDeviceFeature[];
|
||||
state: IDeviceState[];
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface IRoomDefinition {
|
||||
id: string;
|
||||
name: string;
|
||||
floor?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user