dirigera
Version:
A TypeScript client for IKEA's DIRIGERA smart home hub
33 lines (32 loc) • 1.28 kB
TypeScript
import type { CommonDeviceAttributes, Device, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes } from './Device';
export interface CommonControllerAttributes extends CommonDeviceAttributes, JoinableDeviceAttributes, OtaUpdatableDeviceAttributes {
batteryPercentage: number;
isOn: boolean;
lightLevel: number;
circadianPresets?: any[];
}
interface CommonControllerProperties extends Device {
type: 'controller';
isHidden: boolean;
}
export interface ShortcutController extends CommonControllerProperties {
deviceType: 'shortcutController';
attributes: CommonControllerAttributes;
}
export interface LightController extends CommonControllerProperties {
deviceType: 'lightController';
attributes: CommonControllerAttributes;
}
export interface BlindsController extends CommonControllerProperties {
deviceType: 'blindsController';
attributes: CommonControllerAttributes & {
blindsCurrentLevel: number;
blindsState: 'stopped' | 'up' | 'down';
};
}
export interface SoundController extends CommonControllerProperties {
deviceType: 'soundController';
attributes: CommonControllerAttributes;
}
export type Controller = ShortcutController | LightController | SoundController | BlindsController;
export {};