From 8a33150feea0820d60be2459b0d13238f901078d Mon Sep 17 00:00:00 2001 From: Paul Schroeder Date: Tue, 16 Jan 2024 08:22:59 -0700 Subject: [PATCH] #65: fix showOffWhenDisconnected logic --- src/api/VeSync.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/VeSync.ts b/src/api/VeSync.ts index 44bb9d4..527c8fd 100644 --- a/src/api/VeSync.ts +++ b/src/api/VeSync.ts @@ -173,13 +173,13 @@ export default class VeSync { this.log.error( 'VeSync cannot communicate with humidifier! Check the VeSync App.', ); - } - if (this.config.options.showOffWhenDisconnected) { - return false; - } else { - throw new Error( - 'Device was unreachable. Ensure it is plugged in and connected to WiFi.', - ); + if (this.config.options.showOffWhenDisconnected) { + return false; + } else { + throw new Error( + 'Device was unreachable. Ensure it is plugged in and connected to WiFi.', + ); + } } if (!response?.data) {