matterbridge-dyson-robot
Version:
A Matterbridge plugin that connects Dyson robot vacuums and air treatment devices to the Matter smart home ecosystem via their local or cloud MQTT APIs.
47 lines • 3.18 kB
TypeScript
import { DysonMqtt } from './dyson-mqtt.js';
import { TypeMap as DysonMsgMapAir } from './ti/dyson-air-msg-types.js';
import { Config } from './config-types.js';
import { AnsiLogger } from 'matterbridge/logger';
import { DysonAirMsgCurrentFaults, DysonAirMsgCurrentState, DysonAirMsgEnvironmentalCurrentSensorData, DysonAirMsgFaultsChange, DysonAirMsgHello, DysonAirMsgStateChange } from './dyson-air-msg-types.js';
import { DysonAirModuleError, DysonAirModuleWarning, DysonAirProductError, DysonAirProductWarning, DysonAirSensorValueEnum } from './dyson-air-types.js';
import { DysonAirCurrentSensorData } from './dyson-air-sensor-types.js';
import { DysonAirProductState } from './dyson-air-state-types.js';
import { DysonMsgAny } from './dyson-mqtt-parse.js';
import { DeviceConfigMqtt } from './dyson-mqtt-client.js';
type ProductStateNumericEnumKeys = 'cflr' | 'fnsp' | 'nmdv' | 'sltm';
declare const PRODUCT_STATE_NUMERIC_KEYS: readonly ["hmax", "hflr", "filf", "osal", "osau", "cdrr", "cltr", "humt", "rect"];
type ProductStateNumericKeys = typeof PRODUCT_STATE_NUMERIC_KEYS[number];
type ProductStateVerbatimKeys = Exclude<keyof DysonAirProductState, ProductStateNumericEnumKeys | ProductStateNumericKeys>;
export type DysonMqttProductState = Pick<DysonAirProductState, ProductStateVerbatimKeys> & {
[K in ProductStateNumericEnumKeys]?: DysonAirProductState[K] | number;
} & Partial<Record<ProductStateNumericKeys, number>>;
interface Faults {
productErrors: Set<DysonAirProductError>;
productWarnings: Set<DysonAirProductWarning>;
moduleErrors: Set<DysonAirModuleError>;
moduleWarnings: Set<DysonAirModuleWarning>;
}
type SensorDataV2 = 'hchr' | 'p25r' | 'p10r' | 'va10';
export type DysonMqttStatusAirSensor = {
[K in keyof Omit<DysonAirCurrentSensorData, 'sltm' | SensorDataV2>]: DysonAirSensorValueEnum | number;
};
export type DysonMqttStatusAir = Partial<Pick<DysonAirMsgHello, 'version'>> & DysonMqttProductState & DysonMqttStatusAirSensor & Partial<Faults>;
export declare class DysonMqttAir extends DysonMqtt<DysonMsgMapAir, DysonMqttStatusAir> {
private initialiseMsgs;
constructor(log: AnsiLogger, config: Config, device: DeviceConfigMqtt);
updateStateFromMessage(msg: DysonMsgAny<DysonMsgMapAir>): void;
checkIfInitialised(msg: DysonMsgAny<DysonMsgMapAir>): void;
updateProductInfo(msg: DysonAirMsgHello): void;
convertStateChange(msg: DysonAirMsgStateChange): DysonAirMsgCurrentState;
convertFaultsChange(msg: DysonAirMsgFaultsChange): DysonAirMsgCurrentFaults;
updateState(msg: DysonAirMsgCurrentState): void;
updateSensorData(msg: DysonAirMsgEnvironmentalCurrentSensorData): void;
updateFaults(msg: DysonAirMsgCurrentFaults): void;
commandStateSet(productState: DysonMqttProductState): Promise<void>;
parseNumericOrEnumValue<T extends string>(description: string, enumMap: Record<string, T>, value?: string, divisor?: number): number | T | undefined;
}
export declare function KtoC(kelvin: number): number;
export declare function roundedKtoC(kelvin: number): number;
export declare function roundedCtoK(celsius: number): number;
export {};
//# sourceMappingURL=dyson-mqtt-air.d.ts.map