Skip to content

Commit

Permalink
fix: correcting device model on new kind of washer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Feb 13, 2024
1 parent 6eb441a commit ed0bf5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/ThinQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Logger, PlatformConfig} from 'homebridge';
import {API} from './API';
import {LGThinQHomebridgePlatform} from '../platform';
import {Device} from './Device';
import {PlatformType} from './constants';
import {DeviceType, PlatformType} from './constants';
import * as uuid from 'uuid';
import * as Path from 'path';
import * as forge from 'node-forge';
Expand Down Expand Up @@ -107,7 +107,13 @@ export class ThinQ {
}

const modelVersion = parseFloat(deviceModel.Info?.version);
if (modelVersion && modelVersion >= 3 && deviceModel.Info?.defaultTargetDeviceRoot) {

// new washer model
if (device.type === DeviceType[DeviceType.WASH_TOWER_2]
&& modelVersion && modelVersion >= 3
&& deviceModel.Info?.defaultTargetDeviceRoot
&& deviceModel[deviceModel.Info.defaultTargetDeviceRoot]
) {
deviceModel = deviceModel[deviceModel.Info.defaultTargetDeviceRoot];
}

Expand Down

0 comments on commit ed0bf5d

Please sign in to comment.