UNPKG

lavva.exalushome

Version:

Library implementing communication and abstraction layers for ExalusHome system

225 lines (224 loc) 7.75 kB
import { IDeviceTask } from './IDeviceTask'; import { DeviceTaskExecutionResult } from './TaskExecutionResult'; import { IDeviceChannel, TaskExecution } from './IDeviceChannel'; import { FieldChangeResult } from '../FieldChangeResult'; import { ITypedEvent } from '../../TypedEvent'; import { IDeviceState, IDeviceStateData } from './IDeviceState'; export interface IDevice { OnDeviceStateChangedEvent(): ITypedEvent<IDeviceState<IDeviceStateData>>; OnDeviceStateRefreshedOrChangedEvent(): ITypedEvent<IDeviceState<IDeviceStateData>>; OnDeviceTasksExecutionChangedOnChannelsEvent(): ITypedEvent<number[]>; OnDeviceFirmwareVersionChangedEvent(): ITypedEvent<{ FirmwareVersion: string; }>; get Guid(): string; get Name(): string; get IconType(): IconType; get SerialNumber(): string | null; get SoftwareVersion(): string | null; get Model(): string | null; get ModelGuid(): string | null; get ManufacturerGuid(): string | null; get IsVirtual(): boolean; get IsEnabled(): boolean; get ShouldChannelsBeGrouped(): boolean; get DeviceState(): DeviceState; get DeviceType(): DeviceType; get CommunicationWay(): CommunicationWay; get AvailableTaskTypes(): IDeviceTaskTypeInfo[]; get AvailableResponseTypes(): IDeviceResponseTypeInfo[]; get ChannelsAmount(): number; get Channels(): IDeviceChannel[]; get States(): IDeviceState<IDeviceStateData>[]; get ProtocolGuid(): string | null; ChangeDeviceNameAsync(name: string): Promise<FieldChangeResult>; RemoveDeviceAsync(): Promise<DeviceTaskExecutionResult>; ExecuteDeviceTaskAsync(task: IDeviceTask): Promise<DeviceTaskExecutionResult>; ExecuteTaskAsync(task: IDeviceTask): Promise<DeviceTaskExecutionResult>; } export interface IDeviceTaskTypeInfo { get Type(): DeviceTaskType; get InterfaceType(): string; } export declare class DeviceTaskTypeInfo implements IDeviceTaskTypeInfo { private _type; private _interfaceType; get Type(): DeviceTaskType; get InterfaceType(): string; set InterfaceType(value: string); } export declare enum IconType { Unknown = 0, BlindMotor = 1, DinModule = 2, DinModuleWithAntenna = 3, Remote = 4, RemoteForBlinds = 5, RemoteForFacadeBlinds = 6, MovementSensor = 7, TemperatureSensor = 8, HumiditySensor = 9, DinPowerMeter = 10, Intercom = 11, SecurityCamera = 12, Multisensor = 13, FloodSensor = 14, FlushMountedReceiver = 15, FlushMountedBlindController = 16, FlushMountedDimmer = 17, FlushMountedRelay = 18, FlushMountedGateController = 19, WindSensor = 20, FlushMountedGateAndGatewayController = 21, AirPressureSensor = 22, LightBrightnessSensor = 23, ReedSensor = 24, FlushMountedTransceiver = 25, FlushMountedRGBLightController = 26, WallMountedThermoregulator = 27, ImpulseCounter = 28, FlushMountedFacadeController = 29, WallMountedGateController = 30, WallMountedRGBLightController = 31, WallMountedDimmer = 32, WallMountedRemote = 33, DinRelay = 34, DinReceiver = 35, DinBlindController = 36, DinTransceiver = 37, SocketPlugIn = 38, WallMountedRelay = 39, Retransmitter = 40 } export declare enum DeviceTaskType { Unknown = "Unknown", SetBlindPosition = "IBlindPosition", SetBlindPositionSimple = "IBlindPositionSimple", SetBlindMicroventilation = "IMicroventilation", TurnOff = "IChannelOff", TurnOn = "IChannelOn", TurnOnWithTime = "IChannelOnWithTime", TogleState = "IChannelSwitchState", SetLightBrightnessDynamicly = "IDynamicLightBrightness", SetLightBrightness = "ILightBrightness", SetLightColor = "ILightColor", SetLightTemperature = "ILightTemperature", PairDevice = "IPair", UnpairDevice = "IUnpair", IdentifyDevice = "IIdentifyDevice", GetChannelsState = "IGetDeviceState", GetPowerMeasurements = "IGetPowerMeasurements", GetAvailableData = "IGetAvailableData", MultipleDataRequest = "IMultipleDataRequest", SetBlindOpenCloseTime = "ISetBlindOpenCloseTime", SetTemperature = "IChangeTemperature", SetGatePosition = "IGatePosition", SetGatewayPosition = "IGatewayPosition", ChangeGatePositionPulse = "IGatePulse", ChangeGatewayPositionPulse = "IGatewayPulse", SetFacadePosition = "IFacadePosition", GetFacadeType = "IGetFacadeType", LightRGBW = "ILightRGBW", PreciseGateControl = "IPreciseGateControl" } export interface IDeviceResponseTypeInfo { get Type(): DeviceResponseType; get InterfaceType(): string; } export declare class DeviceResponseTypeInfo implements IDeviceResponseTypeInfo { private _type; private _interfaceType; get Type(): DeviceResponseType; get InterfaceType(): string; set InterfaceType(value: string); } export declare enum DeviceResponseType { Unknown = "Unknown", BatteryState = "IBatteryState", BinarySensorState = "IBinarySensor", BlindOpenCloseTime = "IBlindOpenCloseTime", BlindPosition = "IBlindPosition", BlindRemoteButtonState = "IBlindsControlButton", BlindErrorState = "IBlindError", MeasuredBrightness = "IBrightness", RemoteButtonState = "IButtonState", ChannelOnOffState = "IChannelOnOff", IntercomState = "IIntercom", DoorBellState = "IDoorBell", FacadeRemoteButtonState = "IFacadeControlButton", FacadePosition = "IFacadeState", FacadeType = "IFacadeType", FloodSensorState = "IFloodSensor", GatePosition = "IGatePosition", GatewayPosition = "IGatewayPosition", GateControllerHealth = "IGateControllerHealth", HumiditySensorState = "IHumiditySensor", LightBrightness = "ILightBrightness", LightColor = "ILightColor", LightWarmth = "ILightTemperature", LightTreshold = "ILightTreshold", MovementSensorState = "IMovementSensor", OnlineCamera = "IOnlineCamera", OvercurrentProtectionState = "IOvercurrentProtection", OvercurrentProtectionThreshold = "IOvercurrentProtectionThreshold", ReedState = "IReedState", SignalStrength = "ISignalStrength", SmokeSensorState = "ISmokeSensor", MeasuredTemperature = "ITemperature", VibrationSensorState = "IVibrationSensor", MeasuredWindSpeed = "IWindSpeed", WindThreshold = "IWindThreshold", MeasuredEnergy = "IEnergy", MeasuredDistance = "DistanceSensor", BlindCalibration = "BlindCalibration", ConfigurationState = "ConfigurationState", CurrentWindThreshold = "CurrentWindThreshold", CurrentLightThreshold = "CurrentLightThreshold", WindSpeedState = "WindSpeed", TamperProtectionState = "ITamperProtection", PressureSensorState = "IPressureSensor", LightRGBWState = "ILightRGBW" } export declare enum DeviceState { NotResponding = 0, Working = 1, Broken = 2, FirmareUpgradeMode = 3 } export declare enum CommunicationWay { TwoWay = 1, OneWay = 2, ConditionalTwoWay = 3 } export declare enum DeviceType { Unknown = -1, Multipurpose = 0, Controller = 1, Driver = 2, Receiver = 3, Remote = 4, Sensor = 5, Scene = 6 } export declare class DeviceTasksInfo { DeviceGuid: string; Channel: number; Status: TaskExecution; } export declare enum TaskExecutionResult { Unknown = 0, Executed = 1, ResponseTimeout = 2, TaskRepeatedAndExecuted = 3, TaskRepeatedResponseTimeout = 4, FlowControlNotAvailable = 5, ExecutionError = 6 } export interface ManuallyPairedDevice { get ModelGuid(): string; get Model(): string; get Description(): string; get IconType(): IconType; get Channels(): number; get ProtocolExtensionGuid(): string; }