Skip to content

Commit

Permalink
fix: skip un-supported thinq1 device
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Nov 1, 2023
1 parent 002a902 commit a9afb9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export class Helper {
public static make(device: Device) {
if (device.platform === PlatformType.ThinQ1) {
// check if thinq1 available
const deviceClass = V1helper.make(device);
if (deviceClass) {
return deviceClass;
}
return V1helper.make(device);
}

// thinq2
Expand Down
5 changes: 2 additions & 3 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export class LGThinQHomebridgePlatform implements DynamicPlatformPlugin {
continue;
}

this.log.debug('Device data: ', JSON.stringify(device.data));

if (this.config.devices.length && !this.config.devices.find(enabled => enabled.id === device.id)) {
this.log.info('Device skipped: ', device.id);
continue;
Expand All @@ -129,7 +127,8 @@ export class LGThinQHomebridgePlatform implements DynamicPlatformPlugin {

const accessoryType = Helper.make(device);
if (accessoryType === null) {
this.log.info('Device not supported: ' + device.toString());
this.log.info('Device not supported: '+ device.platform + ': ' + device.toString());
this.log.debug('Device data: ', JSON.stringify(device.data));
this.ThinQ.unregister(device).then(() => {
this.log.debug(device.id, '- unregistered!');
});
Expand Down
4 changes: 0 additions & 4 deletions src/v1/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import HoodState from './transforms/HoodState';

export default class Helper {
public static make(device: Device) {
if (device.platform !== PlatformType.ThinQ1) {
return null;
}

switch (device.type) {
case 'DRYER':
case 'WASHER': return Washer;
Expand Down

0 comments on commit a9afb9c

Please sign in to comment.