Add option to enable livolo code. #592

This commit is contained in:
Koen Kanters
2019-02-04 18:39:45 +01:00
parent c9c599b60b
commit 7642b295e1
2 changed files with 11 additions and 3 deletions
+8 -3
View File
@@ -22,7 +22,7 @@ const ExtensionAvailability = require('./extension/availability');
const ExtensionBind = require('./extension/bind');
const ExtensionCoordinatorGroup = require('./extension/coordinatorGroup');
const ExtensionReporting = require('./extension/reporting');
// const ExtensionPollLivoloSwitch = require('./extension/pollLivoloSwitch');
const ExtensionPollLivoloSwitch = require('./extension/pollLivoloSwitch');
class Controller {
constructor() {
@@ -49,8 +49,6 @@ class Controller {
new ExtensionBind(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionCoordinatorGroup(this.zigbee, this.mqtt, this.state, this.publishEntityState),
new ExtensionReporting(this.zigbee, this.mqtt, this.state, this.publishEntityState),
// https://github.com/Koenkk/zigbee2mqtt/issues/592
// new ExtensionPollLivoloSwitch(this.zigbee, this.mqtt, this.state, this.publishEntityState),
];
if (settings.get().homeassistant) {
@@ -70,6 +68,13 @@ class Controller {
this.zigbee, this.mqtt, this.state, this.publishEntityState
));
}
if (settings.get().experimental.livolo) {
// https://github.com/Koenkk/zigbee2mqtt/issues/592
this.extensions.push(new ExtensionPollLivoloSwitch(
this.zigbee, this.mqtt, this.state, this.publishEntityState
));
}
}
onMQTTConnected() {
+3
View File
@@ -12,6 +12,9 @@ const defaults = {
},
groups: {},
device_options: {},
experimental: {
livolo: false,
},
advanced: {
log_directory: path.join(data.getPath(), 'log', '%TIMESTAMP%'),
log_level: process.env.DEBUG ? 'debug' : 'info',