@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
27 lines • 1.55 kB
TypeScript
import { EventBus, ICommandHandler, IEventHandler, QueryBus } from '@nestjs/cqrs';
import { DeviceId, Optional } from '../../common';
import { GoveeDevice, Product } from '../../data';
import { DeviceStatusReceivedEvent } from './cqrs/events';
import { Device } from './device';
import { DevicesFactory } from './devices.factory';
import { DeviceModel } from './devices.model';
import { RefreshDeviceCommand } from './cqrs/commands/refresh-device.command';
export declare class DevicesService implements IEventHandler<DeviceStatusReceivedEvent>, ICommandHandler<RefreshDeviceCommand> {
private readonly factory;
private readonly eventBus;
private readonly queryBus;
private readonly logger;
private readonly deviceMap;
constructor(factory: DevicesFactory, eventBus: EventBus, queryBus: QueryBus);
handle(event: DeviceStatusReceivedEvent): void;
getByModel(model: string): Device<import("./devices.types").DeviceStatesType>[];
getDevice(deviceId: DeviceId): Device<import("./devices.types").DeviceStatesType> | undefined;
getDeviceIds(): string[];
setDevice(device: Device): Device<import("./devices.types").DeviceStatesType>;
execute(command: RefreshDeviceCommand): Promise<any>;
discoverDevice(goveeDevice: GoveeDevice): Promise<Device>;
createDeviceFromModel(deviceModel: DeviceModel): Device;
getProduct(device: GoveeDevice): Promise<Optional<Product>>;
createDeviceModel(device: GoveeDevice, product?: Product): Promise<DeviceModel>;
}
//# sourceMappingURL=devices.service.d.ts.map