lavva.exalushome
Version:
Library implementing communication and abstraction layers for ExalusHome system
80 lines (79 loc) • 4.62 kB
TypeScript
import { Status } from "../../DataFrame";
import { IDIService } from "../../IDIService";
import { ResponseResult } from "../FieldChangeResult";
import { IDevice } from "./IDevice";
import { IDeviceChannel } from "./IDeviceChannel";
export interface IChannelsGroupsService extends IDIService {
WaitForSynchronizationAsync(): Promise<void>;
RemoveGroupAsync(group: IChannelsGroup): Promise<Status>;
RemoveGroupByGuidAsync(groupGuid: string): Promise<Status>;
GetGroupByGuid(guid: string): IChannelsGroup | null;
GetGroupsAsync(): Promise<IChannelsGroup[]>;
IsGroupsAndObjectsOrderingAvailable(): boolean;
MoveGroupPositionAsync(group: IChannelsGroup, newPosition: number): Promise<Status>;
ChangeGroupsOrderAsync(orderedGroups: IChannelsGroup[]): Promise<Status>;
MoveObjectInGroupPositionAsync(group: IChannelsGroup, channel: IDeviceChannel, newPosition: number): Promise<Status>;
ChangeObjectsPositionsInGroupAsync(group: IChannelsGroup, channels: IDeviceChannel[]): Promise<Status>;
SetObjectsInGroupAndOrderAsync(group: IChannelsGroup, objects: Array<IDevice | IDeviceChannel>): Promise<ResponseResult<SetObjectsInGroupAndOrderResponseCode>>;
AddDeviceChannelToGroupAsync(channel: IDeviceChannel, group: IChannelsGroup): Promise<Status>;
AddDeviceChannelToGroupByGuidAsync(channel: IDeviceChannel, groupGuid: string): Promise<Status>;
RemoveDeviceChannelFromGroupAsync(channel: IDeviceChannel, group: IChannelsGroup): Promise<Status>;
RemoveDeviceChannelFromGroupByGuidAsync(channel: IDeviceChannel, groupGuid: string): Promise<Status>;
AddNewGroupAsync(name: string): Promise<IChannelsGroup | ResponseResult<AddNewGroupErrorCode>>;
AddNewGroupWithIconAsync(name: string, iconName: string): Promise<IChannelsGroup | ResponseResult<AddNewGroupErrorCode>>;
UpsertGroupWithDevicesChannelsAsync(group: IChannelsGroup, deviceChannels: IDeviceChannel[]): Promise<IChannelsGroup | ResponseResult<AddNewGroupErrorCode>>;
UpdateGroupWithDevicesChannelsAsync(groupGuid: string, deviceChannels: IDeviceChannel[]): Promise<Status>;
ChangeGroupNameAsync(group: IChannelsGroup, name: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeGroupIconNameAsync(group: IChannelsGroup, iconName: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeGroupNameAndIconAsync(group: IChannelsGroup, name: string, iconName: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeGroupNameByGuidAsync(groupGuid: string, name: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeGroupIconNameByGuidAsync(groupGuid: string, iconName: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeGroupNameAndIconByGuidAsync(groupGuid: string, name: string, iconName: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
}
export declare enum SetObjectsInGroupAndOrderResponseCode {
Success = "Success",
GroupDoesNotExists = "GroupDoesNotExists",
ObjectDoesNotExists = "ObjectDoesNotExists",
FatalError = "FatalError",
FunctionNotSupported = "FunctionNotSupported"
}
export declare enum AddNewGroupErrorCode {
Success = "Success",
NoPermissions = "NoPermissions",
NameToShort = "NameToShort",
NameAlreadyExists = "NameAlreadyExists",
OtherError = "OtherError",
UnknownError = "UnknownError"
}
export interface IChannelsGroup {
get Guid(): string;
get Name(): string;
get IconName(): string;
get OrderPosition(): number;
get ObjectsOrder(): Record<number, string>;
GetDevicesChannelsInGroupAsync(withScenes: boolean): Promise<IDeviceChannel[]>;
ChangeNameAsync(name: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeIconNameAsync(name: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
}
export declare class ChannelsGroup implements IChannelsGroup {
private _guid;
private _name;
private _iconName;
private _position;
private _objectsOrder;
private static _devicesService;
constructor();
GetDevicesChannelsInGroupAsync(withScenes?: boolean): Promise<IDeviceChannel[]>;
get Guid(): string;
set Guid(value: string);
get Name(): string;
set Name(value: string);
get IconName(): string;
set IconName(value: string);
get OrderPosition(): number;
set OrderPosition(value: number);
get ObjectsOrder(): Record<number, string>;
set ObjectsOrder(value: Record<number, string>);
ChangeNameAsync(name: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
ChangeIconNameAsync(iconName: string): Promise<ResponseResult<AddNewGroupErrorCode>>;
}