Refactor homeassistant configuration out of devices.js. #45

This commit is contained in:
Koenkk
2018-05-16 19:40:05 +02:00
parent ca40cf622a
commit 8559ea2301
7 changed files with 56 additions and 39 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ class Controller {
// MQTT discovery of all paired devices on startup.
this.zigbee.getAllClients().forEach((device) => {
if (deviceMapping[device.modelId]) {
homeassistant.discover(device.ieeeAddr, deviceMapping[device.modelId].homeassistant, this.mqtt);
homeassistant.discover(device.ieeeAddr, deviceMapping[device.modelId].model, this.mqtt);
}
});
}
@@ -127,7 +127,7 @@ class Controller {
// Home Assistant MQTT discovery
if (settings.get().homeassistant) {
homeassistant.discover(device.ieeeAddr, mappedModel.homeassistant, this.mqtt);
homeassistant.discover(device.ieeeAddr, mappedModel.model, this.mqtt);
}
// After this point we cant handle message withoud cid anymore.