UNPKG

@shadman-a/homebridge-my-ac

Version:

A Homebridge plugin for controlling/monitoring LG ThinQ devices via LG ThinQ platform.

129 lines (128 loc) 4.39 kB
/** * Special thank to carlosgamezvillegas (https://github.com/carlosgamezvillegas) for the initial work on the Microwave device. */ import { AccessoryContext, BaseDevice } from '../baseDevice.js'; import { Device } from '../lib/Device.js'; import { DeviceModel } from '../lib/DeviceModel.js'; import { LGThinQHomebridgePlatform } from '../platform.js'; import { Logger, PlatformAccessory } from 'homebridge'; export default class Microwave extends BaseDevice { readonly platform: LGThinQHomebridgePlatform; readonly accessory: PlatformAccessory<AccessoryContext>; protected inputNameStatus: string; protected inputNameMode: string; protected inputNameTempString: string; protected courseStartString: string; protected courseTimeString: string; protected courseTimerString: string; protected courseTimeEndString: string; protected inputNameOptions: string; protected firstStart: boolean; protected firstDuration: number; protected firstTimer: number; protected courseStartMS: number; protected inputID: number; protected temperatureFCommand: number; protected thermostatSel: number; protected timerAlarmSec: number; protected pauseUpdate: boolean; protected firstPause: boolean; protected ventSpeed: number; protected lampLevel: number; protected mwPower: number; protected localTemperature: number; protected localHumidity: number; protected defaultTemp: number; protected waitingForCommand: boolean; protected ovenCommandList: { ovenMode: string; ovenSetTemperature: number; tempUnits: any; ovenSetDuration: number; subCookNumber: number; weightUnits: string; microwavePower: string; targetWeight: number; }; protected showTime: boolean; protected showTimer: boolean; protected monitorOnly: boolean; protected timeOut: number; /** Service */ private serviceHood; private serviceLight; private microwavePower; private ovenService; private ovenState; private lightVent; private ovenMode; private ovenTemp; private ovenOptions; private ovenStart; private ovenTimer; private ovenTime; private ovenEndTime; private ovenTimerService; private ovenAlarmService; private microwaveSwitch; private combiBakeSwitch; private dehydrateSwitch; private ovenSwitch; private convectionBakeSwitch; private convectionRoastSwitch; private frozenMealSwitch; private defrostSwitch; private airFrySwitch; private proofSwitch; private warmModeSwitch; private cancelSwitch; private startOvenSwitch; private ovenTempControl; private offSwitch; constructor(platform: LGThinQHomebridgePlatform, accessory: PlatformAccessory<AccessoryContext>, logger: Logger); timeModeCommand(): Promise<void>; sendLightVentCommand(): Promise<void>; sendTimerCommand(time: number): Promise<void>; sendOvenCommand(): void; stopOven(): Promise<void>; setActive(): void; onStatus(): boolean; lightVentState(): boolean; nameLengthCheck(newName: string): string; secondsToTime(seconds: number): string; remainTime(): number; ovenModeName(): string; ovenStatus(): string; ovenTemperature(): string; ovenCurrentTemperature(): number; ovenTargetTemperature(): number; OvenSubCookMenu(name: string): string; oventTargetTime(): number; ovenTimerTime(): number; tempCtoF(temp: number): number; tempFtoC(temp: number): number; ovenCookingDuration(): string; ovenCookingTimer(): string; ovenCookingStartTime(): string; ovenCookingEndTime(): string; oventOptions(): string; currentHeatingState(): 0 | 1; targetHeatingState(): 0 | 1; updateOvenModeSwitch(): void; updateOvenModeSwitchNoPause(): void; getOperationTime(timeInSeconds: number): string; lightVentStatus(): string; ovenServiceActive(): 0 | 1; updateAccessoryCharacteristic(device: Device): void; update(snapshot: any): void; get Status(): MicrowaveStatus; get config(): { oven_trigger: boolean; } & Record<string, any>; } export declare class MicrowaveStatus { data: any; protected deviceModel: DeviceModel; constructor(data: any, deviceModel: DeviceModel); getState(key: string): any; }