homebridge-tuya-laundry
Version:
Allows washer/dryer cycle completion notifications using Tuya smart plugs with power meter, now using local control.
53 lines • 2.39 kB
TypeScript
import { LaundryDeviceConfig } from '../interfaces/notifyConfig';
import { API, Logger, PlatformAccessory } from 'homebridge';
import { MessageGateway } from './messageGateway';
import { SmartPlugService } from './smartPlugService';
export declare class LaundryDeviceTracker {
readonly log: Logger;
readonly messageGateway: MessageGateway;
config: LaundryDeviceConfig;
api: API;
private smartPlugService;
private startDetected?;
private startDetectedTime?;
private isActive?;
private endDetected?;
private endDetectedTime?;
private cumulativeConsumption;
private cumulativeSinceStartDetected;
private lastMeasurementTime;
private lastDpsStatus;
private currentInterval;
private powerLog;
private startTime?;
private endTime?;
private minPower;
private maxPower;
private totalPower;
private sampleCount;
private lastFullCycleEndTime?;
private dryRunRuns;
accessory?: PlatformAccessory;
constructor(log: Logger, messageGateway: MessageGateway, config: LaundryDeviceConfig, api: API, smartPlugService: SmartPlugService);
init(localDevices?: any[]): Promise<void>;
private detectStartStop;
private getPowerValue;
private adjustInterval;
/** True if any min-run criteria are configured (used to distinguish full cycles from short after-run cycles). */
private hasMinRunCriteriaConfigured;
/** After-run window in minutes (supports deprecated nachlaufWindowMin for backward compatibility). */
private getAfterRunWindowMin;
/** True if we are within the after-run window (minutes after last full cycle end). Inside this window, start is only confirmed once min-run criteria are met. */
private isInsideAfterRunWindow;
/** True if the run (duration, energy, avg power) meets all configured min-run criteria (i.e. counts as a full cycle). */
private meetsMinRunCriteria;
private checkStartStopConditions;
/** Dry run: record run stats and write suggested thresholds to logs/dry-run-<deviceId>.json */
private logRunAndSuggestThresholds;
/** From recorded runs, suggest min-run thresholds that separate full cycles from short after-run cycles. */
private computeSuggestedThresholds;
private incomingData;
private updateAccessorySwitchState;
private exportPowerLog;
}
//# sourceMappingURL=laundryDeviceTracker.d.ts.map