UNPKG

lavva.exalushome.extalife

Version:

Library implementing communication and abstraction layers for ExtaLife API in ExalusHome system

71 lines (70 loc) 4.78 kB
import { IDeviceConfigService } from 'lavva.exalushome/build/js/Services/Devices/IDeviceConfigService'; import { IDevice } from 'lavva.exalushome/build/js/Services/Devices/IDevice'; import { AccLevel, LuxSettingThreshold, MovementDetectorParams, MoveSensorExternalOutputMode, MoveSensorMode, PirDetection, PirDetectionThreshold, PirPredefinedSettings, PirSensorParams, PirWindowTime } from './Rcr21ConfigParams'; import { ResponseResult } from "lavva.exalushome/build/js/Services/FieldChangeResult"; import { GetParamsErrorCode, SynchronizationTime } from "../../../ExtaLife"; import { Status } from 'lavva.exalushome/build/js/DataFrame'; export interface IRcr21ConfigService extends IDeviceConfigService { GetPirSensorParamsAsync(device: IDevice, channel: number): Promise<PirSensorParams | ResponseResult<GetParamsErrorCode>>; SetPirSensorParamsAsync(params: PirSensorParams, channel: number): Promise<Status>; /** * Sets PirDetectionThreshold * 0 - high detection level (high sensitivity ), small objects trigger the sensor. 255 - low detection level( reduced sensitivity ), small objects within a certain distance do not trigger the sensor. * Option availiable only when PredefinedSettings is set to 0! * @param device * @param detectionThreshold * @returns relevant status, if PredefinedSettings != 0 returns Status.OperationNotPermitted */ SetDetectionThresholdAsync(device: IDevice, channel: number, detectionThreshold: PirDetectionThreshold): Promise<Status>; /** * Sets the time during which the number of pulses specified by the "Detection" parameter must occur. Time is specified in secounds and its calculated by this value: WindowTime = 2s + this value * Option availiable only when PredefinedSettings is set to 0! * @param device * @param windowTime * @returns relevant status, if PredefinedSettings != 0 returns Status.OperationNotPermitted */ SetWindowTimeAsync(device: IDevice, channel: number, windowTime: PirWindowTime): Promise<Status>; /** * Sets the number of pulses detected by the PIR after which a frame is sent. * Option availiable only when PredefinedSettings is set to 0! * @param device * @param detection * @returns relevant status, if PredefinedSettings != 0 returns Status.OperationNotPermitted */ SetDetectionAsync(device: IDevice, channel: number, detection: PirDetection): Promise<Status>; /** * Sets Predefined DetectionThreshold, WindowTime and Detection settings * If we want to use custom parameters of DetectionThreshold, WindowTime and Detection we have to set this predefinedSettings to 0! * @param device * @param predefinedSettings * @returns */ SetPredefinedSettingsAsync(device: IDevice, channel: number, predefinedSettings: PirPredefinedSettings): Promise<Status>; GetMovementDetectorParamsAsync(device: IDevice, channel: number): Promise<MovementDetectorParams | ResponseResult<GetParamsErrorCode>>; SetMovementDetectorParamsAsync(params: MovementDetectorParams, channel: number): Promise<Status>; /** * Time after which the state of motion detection is restored to the default state (no move detected) * If offTime is out of range method returns Status.WrongData * @param device * @param offTime range between 10s - 3600s * @returns */ SetOffTimeAsync(device: IDevice, channel: number, offTime: number): Promise<Status>; /** * Motion detector threshold based on brightness value for day or night working mode * For DayMode - value is mapped to range 20 - 200 lux * For NightMode - value is mapped to range from 4 - 20lux * @param device * @param luxSetting brightness value - range between 0 - 66 * @returns */ SetLuxSettingAsync(device: IDevice, channel: number, luxSetting: LuxSettingThreshold): Promise<Status>; SetSynchronizationTimeAsync(device: IDevice, channel: number, syncTime: SynchronizationTime): Promise<Status>; SetAccTamperEventAsync(device: IDevice, channel: number, tamperEvent: boolean): Promise<Status>; SetAccLevelAsync(device: IDevice, channel: number, accLevel: AccLevel): Promise<Status>; SetSensorModeAsync(device: IDevice, channel: number, sensorMode: MoveSensorMode): Promise<Status>; SetExternalOutModeAsync(device: IDevice, channel: number, externalOutputMode: MoveSensorExternalOutputMode): Promise<Status>; SetOpticalLEDSignalizationAsync(device: IDevice, channel: number, opticalLEDSignalization: boolean): Promise<Status>; SetMoveLEDSignalizationAsync(device: IDevice, channel: number, moveLEDSignalization: boolean): Promise<Status>; ClearTamperAlarmAsync(device: IDevice, channel: number): Promise<Status>; }