From 8dddd620d5e1e4c20bc9ae55e63ff59b9f7c9771 Mon Sep 17 00:00:00 2001 From: foxriver76 Date: Thu, 11 Apr 2024 14:53:27 +0200 Subject: [PATCH] remove some warnings which should only be debug log - closes #709, closes #730 --- README.md | 3 +++ lib/alexaSmartHomeV2.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d552897c..2bd2d905 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,9 @@ setState('iot.0.app.message', JSON.stringify({ --> ## Changelog +### **WORK IN PROGRESS** +* (foxriver76) remove some warnings which should only be debug log + ### 3.2.1 (2024-04-11) * (foxriver76) fixed issue that only valid JSON could be sent to app via message state diff --git a/lib/alexaSmartHomeV2.js b/lib/alexaSmartHomeV2.js index 067aae81..dcaa8a29 100644 --- a/lib/alexaSmartHomeV2.js +++ b/lib/alexaSmartHomeV2.js @@ -506,11 +506,13 @@ function AlexaSH2(adapter) { let byON = (smartName && typeof smartName === 'object') ? smartName.byON : null; if (toggle && toggle !== id) { - throw new Error(`Won't control ${id} as we have a switch available`); + adapter.log.debug(`Won't control ${id} as we have a switch available`); + return } if (byON === 'omit') { - throw new Error(`Won't control value for "${id}", because "omit" configured`); + adapter.log.debug(`Won't control value for "${id}", because "omit" configured`); + return } if (obj.common.type === 'number') {