From 869cc684420d2ec444f7a878e885046fc3c57d56 Mon Sep 17 00:00:00 2001 From: Gonzalo Ayuso Date: Sun, 30 Apr 2017 19:05:04 +0200 Subject: [PATCH] clean --- README.md | 5 ++--- www/gonzalo123/Component.js | 4 +--- www/gonzalo123/controller/Controller.controller.js | 4 +--- www/index.html | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2890246..e4d5d44 100644 --- a/README.md +++ b/README.md @@ -219,15 +219,14 @@ sap.ui.define([ var i18nModel = new ResourceModel({ bundleName: "gonzalo123.i18n.i18n" }); + this.getView().setModel(i18nModel, "i18n"); }, 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") + payload: (this.getView().getModel().oData.light.status ? "1" : "0") }); } }); diff --git a/www/gonzalo123/Component.js b/www/gonzalo123/Component.js index 7fb8232..5dd5534 100644 --- a/www/gonzalo123/Component.js +++ b/www/gonzalo123/Component.js @@ -2,7 +2,7 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/core/UIComponent'], function (jQuery, UIComponent) { "use strict"; - var Component = UIComponent.extend("gonzalo123.Component", { + return UIComponent.extend("gonzalo123.Component", { metadata: { rootView: "gonzalo123.view.App", routing: { @@ -27,6 +27,4 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/core/UIComponent'], this.getTargets().display("main"); } }); - - return Component; }); diff --git a/www/gonzalo123/controller/Controller.controller.js b/www/gonzalo123/controller/Controller.controller.js index 0a7e913..c4fa9e6 100644 --- a/www/gonzalo123/controller/Controller.controller.js +++ b/www/gonzalo123/controller/Controller.controller.js @@ -50,11 +50,9 @@ sap.ui.define([ }, 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") + payload: (this.getView().getModel().oData.light.status ? "1" : "0") }); } }); diff --git a/www/index.html b/www/index.html index 2293a13..2a1ec64 100644 --- a/www/index.html +++ b/www/index.html @@ -29,7 +29,6 @@ }).placeAt("content"); }); -