aboutsummaryrefslogtreecommitdiff
path: root/src/mqtt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-10-31 14:09:39 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-10-31 14:09:39 +0100
commit803148d5a23afe207fb5de9ac73c986a324feb9c (patch)
treeb887cede3f56e4e24c05dd9640dbd01afc2b9367 /src/mqtt
parent02d6e77bd180cbbf6f7f6e1a69c670e922d8204d (diff)
downloaddiller-server-803148d5a23afe207fb5de9ac73c986a324feb9c.tar.gz
diller-server-803148d5a23afe207fb5de9ac73c986a324feb9c.tar.bz2
diller-server-803148d5a23afe207fb5de9ac73c986a324feb9c.tar.xz
diller-server-803148d5a23afe207fb5de9ac73c986a324feb9c.zip
core:
o Improved transaction handling. web: o Supporting changing a device's name and description.
Diffstat (limited to 'src/mqtt')
-rw-r--r--src/mqtt/DillerMqtt.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mqtt/DillerMqtt.js b/src/mqtt/DillerMqtt.js
index 3fe43dc..e991b40 100644
--- a/src/mqtt/DillerMqtt.js
+++ b/src/mqtt/DillerMqtt.js
@@ -1,7 +1,7 @@
var di = require('di');
var mqtt = require('mqtt');
-function DillerMqtt(config, diller) {
+function DillerMqtt(config, tx) {
var log = config.log();
function run() {
@@ -22,7 +22,9 @@ function DillerMqtt(config, diller) {
});
mqttClient.on('message', function (topic, message, payload) {
- diller.onMessage(topic, message, payload);
+ tx(function (pg, dao, diller) {
+ return diller.onMessage(topic, message, payload);
+ });
});
}
@@ -30,9 +32,9 @@ function DillerMqtt(config, diller) {
run: run
};
}
-var Diller = require('../Diller');
+var DillerTx = require('../DillerTx');
var DillerConfig = require('../DillerConfig');
-di.annotate(DillerMqtt, new di.Inject(DillerConfig, Diller));
+di.annotate(DillerMqtt, new di.Inject(DillerConfig, DillerTx));
module.exports = DillerMqtt;