@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
62 lines • 3.28 kB
TypeScript
import { ActiveState, ActiveStateName } from './states/active.state';
import { BatteryLevelState, BatteryLevelStateName } from './states/battery-level.state';
import { BrightnessState, BrightnessStateName } from './states/brightness.state';
import { ColorRGBState, ColorRGBStateName } from './states/color-rgb.state';
import { ConnectedState, ConnectedStateName } from './states/connected.state';
import { DisplayScheduleState, DisplayScheduleStateName } from './states/display-schedule.state';
import { FilterExpiredState, FilterExpiredStateName } from './states/filter-expired.state';
import { FilterLifeState, FilterLifeStateName } from './states/filter-life.state';
import { HumidityState, HumidityStateName } from './states/humidity.state';
import { LightEffectState, LightEffectStateName } from './states/light-effect.state';
import { ModeState, ModeStateName } from './states/mode.state';
import { NightLightState, NightLightStateName } from './states/night-light.state';
import { PowerState, PowerStateName } from './states/power.state';
import { TemperatureState, TemperatureStateName } from './states/temperature.state';
import { TimerState, TimerStateName } from './states/timer.state';
import { WaterShortageState, WaterShortageStateName } from './states/water-shortage.state';
import { ControlLockState, ControlLockStateName } from './states/control-lock.state';
import { Optional } from '../../common/types';
import { Version } from './version.info';
import { DeviceState } from './states/device.state';
export type DeviceType<States extends DeviceStatesType = StandardDeviceStates> = {
get name(): string;
get id(): string;
get model(): string;
get goodsType(): number;
get pactCode(): number;
get pactType(): number;
get iotTopic(): Optional<string>;
get bleAddress(): Optional<string>;
get version(): Version;
get states(): States;
currentStates(): DeviceStateValues<States>;
logState(): void;
};
export type DeviceStatesType = {
[]: Optional<DeviceState<typeof StateName, any>>;
};
export type StandardDeviceStates = {
[]: Optional<ActiveState>;
[]: Optional<BatteryLevelState>;
[]: Optional<BrightnessState>;
[]: Optional<ColorRGBState>;
[]: Optional<ConnectedState>;
[]: Optional<ControlLockState>;
[]: Optional<DisplayScheduleState>;
[]: Optional<FilterExpiredState>;
[]: Optional<FilterLifeState>;
[]: Optional<HumidityState>;
[]: Optional<LightEffectState>;
[]: Optional<ModeState>;
[]: Optional<NightLightState>;
[]: Optional<PowerState>;
[]: Optional<TemperatureState>;
[]: Optional<TimerState>;
[]: Optional<WaterShortageState>;
};
export type DeviceStateValues<States extends DeviceStatesType> = {
[]: StateName extends ModeStateName ? Optional<string> : States[StateName] extends {
value: infer U;
} ? U : undefined;
};
//# sourceMappingURL=devices.types.d.ts.map