Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalo123 committed Apr 30, 2017
1 parent 21b40bc commit c59f3d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,13 @@ sap.ui.define([
this.getView().setModel(i18nModel, "i18n");
},

onStatusChange: function (oEvent) {
onStatusChange: function () {
var status = this.getView().getModel().oData.light.status
console.log("onStatusChange", status);
io.emit('mqtt', {
topic: 'sensors/arduino/light/change',
payload: (status ? "1" : "0")
});
},

onColorChange: function (oEvent) {
var color = oEvent.getSource().data("color");
var value = this.getView().getModel().oData.light[color];
console.log(color, value);
io.emit('mqtt', {
topic: 'sensors/arduino/light/' + color + '/change',
payload: value
});
}
});
}
Expand Down Expand Up @@ -287,4 +277,4 @@ httpServer.listen(3000, '0.0.0.0');
* pull down resistor

# Demo
[![Playing with mqtt, Arduino, Raspberry Pi and OpenUI5 ](http://img.youtube.com/vi/4cdecwQ74U4/0.jpg)](https://www.youtube.com/watch?v=4cdecwQ74U4)
[![Playing with mqtt, Arduino, Raspberry Pi and OpenUI5](http://img.youtube.com/vi/4cdecwQ74U4/0.jpg)](https://www.youtube.com/watch?v=4cdecwQ74U4)
13 changes: 2 additions & 11 deletions www/gonzalo123/controller/Controller.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,17 @@ sap.ui.define([
var i18nModel = new ResourceModel({
bundleName: "gonzalo123.i18n.i18n"
});

this.getView().setModel(i18nModel, "i18n");
},

onStatusChange: function (oEvent) {
onStatusChange: function () {
var status = this.getView().getModel().oData.light.status
console.log("onStatusChange", status);
io.emit('mqtt', {
topic: 'sensors/arduino/light/change',
payload: (status ? "1" : "0")
});
},

onColorChange: function (oEvent) {
var color = oEvent.getSource().data("color");
var value = this.getView().getModel().oData.light[color];
console.log(color, value);
io.emit('mqtt', {
topic: 'sensors/arduino/light/' + color + '/change',
payload: value
});
}
});
}
Expand Down

0 comments on commit c59f3d0

Please sign in to comment.