Improve robustness.

This commit is contained in:
Koen Kanters
2018-04-18 21:55:00 +02:00
parent 3b068daa12
commit 90cc4ad0e1
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -113,6 +113,7 @@ class Controller {
const deviceID = Object.keys(settings.get().devices).find((id) => settings.get().devices[id].friendly_name === friendlyName);
if (!deviceID) {
logger.error(`Cannot handle '${topic}' because deviceID of '${friendlyName}' cannot be found`);
return;
}
// Convert the MQTT message to a Zigbee message.
+1
View File
@@ -103,6 +103,7 @@ class Zigbee {
const device = this.shepherd.find(deviceID, 1);
if (!device) {
logger.error(`Zigbee cannot publish message to device because '${deviceID}' is not known by zigbee-shepherd`);
return;
}
logger.info(`Zigbee publish to '${deviceID}', ${cId} - ${cmd} - ${JSON.stringify(zclData)}`);