mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 22:08:32 +00:00
Merge pull request #325 from sebastianheierhoff/master
Fix issue #306: Sending config msg works only with default topic
This commit is contained in:
+3
-3
@@ -367,7 +367,7 @@ class Controller {
|
||||
}
|
||||
|
||||
handleMQTTMessageConfig(topic, message) {
|
||||
const option = topic.split('/')[3];
|
||||
const option = topic.split('/').slice(-1)[0];
|
||||
|
||||
if (option === 'permit_join') {
|
||||
this.zigbee.permitJoin(message.toString().toLowerCase() === 'true');
|
||||
@@ -471,8 +471,8 @@ class Controller {
|
||||
}
|
||||
|
||||
handleMQTTMessageDevice(topic, message, withPrefix) {
|
||||
const friendlyName = topic.split('/')[1];
|
||||
const topicPrefix = withPrefix ? topic.split('/')[2] : '';
|
||||
const friendlyName = topic.split('/').slice(-2)[0];
|
||||
const topicPrefix = withPrefix ? topic.split('/').slice(-3)[0] : '';
|
||||
|
||||
// Map friendlyName to deviceID.
|
||||
const deviceID = settings.getIDByFriendlyName(friendlyName);
|
||||
|
||||
Reference in New Issue
Block a user