Fix topicPrefix parsing. #387

This commit is contained in:
Koen Kanters
2018-09-21 11:12:51 +02:00
committed by GitHub
parent ade84dc6c0
commit 75acffa8c7
+1 -1
View File
@@ -479,7 +479,7 @@ class Controller {
handleMQTTMessageDevice(topic, message, withPrefix) {
const friendlyName = topic.split('/').slice(withPrefix ? -3 : -2)[0];
const topicPrefix = withPrefix ? topic.split('/').slice(-3)[0] : '';
const topicPrefix = withPrefix ? topic.split('/').slice(-2)[0] : '';
// Map friendlyName to deviceID.
const deviceID = settings.getIDByFriendlyName(friendlyName);