From b9afead6b430039b7e7acfd360273f6a373fc792 Mon Sep 17 00:00:00 2001 From: nVuln Date: Sat, 25 May 2024 00:04:28 +0700 Subject: [PATCH] fix: washer door lock status on some new washer --- src/devices/WasherDryer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/devices/WasherDryer.ts b/src/devices/WasherDryer.ts index 019b84e..003b18d 100644 --- a/src/devices/WasherDryer.ts +++ b/src/devices/WasherDryer.ts @@ -227,7 +227,12 @@ export class WasherDryerStatus { } public get isDoorLocked() { - return this.data.doorLock === this.deviceModel.lookupMonitorName('doorLock', '@CP_ON_EN_W'); + const current = this.deviceModel.lookupMonitorName('doorLock', '@CP_ON_EN_W'); + if (current === null) { + return this.data.doorLock === 'DOORLOCK_ON'; + } + + return this.data.doorLock === current; } public get remainDuration() {