From a8dca627d9848e3cfee44bf35a85335837839d84 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 3 Jun 2018 00:42:15 +0200 Subject: [PATCH] Allow spaces in MQTT device commands (for friendly names with spaces in it). #86 --- lib/controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/controller.js b/lib/controller.js index e472f402..e2809f4b 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -8,8 +8,8 @@ const objectAssignDeep = require(`object-assign-deep`); const debug = require('debug')('zigbee2mqtt:controller'); const mqttConfigRegex = new RegExp(`${settings.get().mqtt.base_topic}/bridge/config/\\w+`, 'g'); -const mqttDeviceRegex = new RegExp(`${settings.get().mqtt.base_topic}/\\w+/set`, 'g'); -const mqttDevicePrefixRegex = new RegExp(`${settings.get().mqtt.base_topic}/\\w+/\\w+/set`, 'g'); +const mqttDeviceRegex = new RegExp(`${settings.get().mqtt.base_topic}/[\\w\\s\\d]+/set`, 'g'); +const mqttDevicePrefixRegex = new RegExp(`${settings.get().mqtt.base_topic}/[\\w\\s\\d]+/[\\w\\s\\d]+/set`, 'g'); const pollInterval = 60 * 1000; // seconds * 1000. const softResetTimeout = 3600 * 1000; // seconds * 1000.