Преглед на файлове

fix "replace multiple spaces", add "current round".

Luigi Cisana преди 7 години
родител
ревизия
9d82782534
променени са 2 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 1 1
      package.json
  2. 3 1
      ramp-thermostat/ramp-thermostat.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
     "name"         : "node-red-contrib-ramp-thermostat",
-    "version"      : "0.3.2",
+    "version"      : "0.3.3",
     "description"  : "A Node-RED node that emulates a thermostat",
     "dependencies": {
     },

+ 3 - 1
ramp-thermostat/ramp-thermostat.js

@@ -18,7 +18,7 @@ module.exports = function(RED) {
     
     var node_name;
     if (typeof this.name !== "undefined" ) {
-      node_name = this.name.replace(" ", "_");
+      node_name = this.name.replace(/\s/g, "_");
     } else {
       node_name = this.id;
     }
@@ -161,6 +161,8 @@ module.exports = function(RED) {
     var state;
     var status = {};
     
+    current = parseFloat((current).toFixed(1));
+    
     var date = new Date();
     var current_mins = date.getHours()*60 + date.getMinutes();