From 88cec5dfa673aceae49d166957a8615edca87a5c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Feb 2019 20:06:14 +0100 Subject: [PATCH] Check for valid Zigbee channel. https://github.com/Koenkk/zigbee2mqtt/issues/1077 --- lib/zigbee.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/zigbee.js b/lib/zigbee.js index b2f9e99c9..ae43f6631 100644 --- a/lib/zigbee.js +++ b/lib/zigbee.js @@ -8,6 +8,11 @@ const Queue = require('queue'); const zclId = require('zcl-id'); const advancedSettings = settings.get().advanced; + +if (advancedSettings.channel < 11 || advancedSettings.channel > 26) { + throw new Error(`'${advancedSettings.channel}' is an invalid channel, use a channel between 11 - 26.`); +} + const shepherdSettings = { net: { panId: advancedSettings.pan_id,