Updates based om comments from @SweVictor

This commit is contained in:
faanskit 2021-05-06 07:58:06 +02:00
parent 531aa8ee3e
commit c8890b8cd7
5 changed files with 29 additions and 15 deletions

View file

@ -126,13 +126,16 @@ class PlejdAddon extends EventEmitter {
},
);
this.plejdDeviceCommunication.on(PlejdDeviceCommunication.EVENTS.buttonPressed, (data) => {
try {
this.mqttClient.buttonPressed(data);
} catch (err) {
logger.error('Error in PlejdService.sceneTriggered callback', err);
}
});
this.plejdDeviceCommunication.on(
PlejdDeviceCommunication.EVENTS.buttonPressed,
(deviceId, deviceInput) => {
try {
this.mqttClient.buttonPressed(deviceId, deviceInput);
} catch (err) {
logger.error('Error in PlejdService.buttonPressed callback', err);
}
},
);
this.plejdDeviceCommunication.on(PlejdDeviceCommunication.EVENTS.sceneTriggered, (sceneId) => {
try {