UNPKG

lavva.exalushome.extalife

Version:

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

66 lines (65 loc) 3.33 kB
import { Status } from "lavva.exalushome/build/js/DataFrame"; import { IDevice } from "lavva.exalushome/build/js/Services/Devices/IDevice"; import { IDeviceConfigService } from "lavva.exalushome/build/js/Services/Devices/IDeviceConfigService"; import { ResponseResult } from "lavva.exalushome/build/js/Services/FieldChangeResult"; import { IRemoteDevice } from "./RemoteParams"; import { RemoteServiceErrorCode } from "./RemotesService"; export interface IRemotesService extends IDeviceConfigService { /** * Function returns currently paired remotes to given device and channel of device. * @param device - The device from which you want to read the paired remote controls * @param channel - Channel of device * @returns * SUCCESS: Array of remotes * FAILED: ResponseResult * - InvalidChannelNumber * - OtherError * - NoData * - NoPairedRemotes */ GetPairedRemotesAsync(device: IDevice, channel: number): Promise<IRemoteDevice[] | ResponseResult<RemoteServiceErrorCode>>; /** * Functions to change currently paired remote options, options in IRemoteDevice that can be changed: * - RemoteMode value (should not be changed for blinds and facade!) * - properties in object CurrentRemotePairingOptions * @param remote - Paired remote (from GetPairedRemotesAsync(..args) result array) * @returns * SUCCESS: Status.OK * FAILED: ResponseResult * - OtherError * - NoData * - IllegalButtonNumber * - ButtonAlreadyAssigned * - IllegalTimeValue */ EditRemoteOptionsAsync(remote: IRemoteDevice): Promise<ResponseResult<RemoteServiceErrorCode> | Status>; /** * Method to generate remotes object (including configuration and default RemoteMode) which can be assigned to a controlled device. One of remote generated by this function can be assigned to device by method AssingRemoteToDeviceAsync(remote: IRemoteDevice) * @param deviceToControl - Device that we want to control by newly added remote * @param channelToControll - Channel of device * @returns Array of IRemoteDevice, when deviceToControl does not supports Remotes or Remotes are not paired with controller method returns empty array. */ GetAvailableRemotesForDeviceAsync(deviceToControl: IDevice, channelToControll: number): Promise<IRemoteDevice[]>; /** * Function to assign remote to device, remote must be generated before by function GetAvailableRemotesForDeviceAsync(..args) - in this method is assigned a device identifier, default options and appropriate RemoteMode. * @returns * SUCCESS: Status.OK * FAILED: ResponseResult * - OtherError * - NoData * - IllegalButtonNumber * - ButtonAlreadyAssigned * - IllegalTimeValue */ AssingRemoteToDeviceAsync(remote: IRemoteDevice): Promise<ResponseResult<RemoteServiceErrorCode> | Status>; /** * Method to remove assigned remote from device. * @param remote - assigned remote that shoudl be disassociate - remote from array obtained from GetPairedRemotesAsync * @returns * SUCCESS: Status.OK * FAILED: ResponseResult * - OtherError * - NoData */ RemoveRemoteFromDeviceAsync(remote: IRemoteDevice): Promise<ResponseResult<RemoteServiceErrorCode> | Status>; }