var sensors = require('ds1820-temp');

function TemperatureSensor(callback) {
  if (!(this instanceof TemperatureSensor)) {
    return new TemperatureSensor();
  }

  this.temperature = null;
  this.onChange = callback;
  this.update();

  var that = this;

  setInterval(function() {
    that.update();
  }, 60 * 1000);
};

TemperatureSensor.prototype.update = function() {
  var that = this;

  sensors.readDevices(function(err, devices) {
    var value = devices[0].value;

    if (that.temperature == value)
      return;

    that.temperature = value;
    that.onChange(that.temperature);
  });
};

module.exports = TemperatureSensor;


@@ -150,16 +150,24 @@
 eSensor(
+callback
 );%0A  %7D%0A%0A
@@ -451,20 +451,21 @@
     var 
-valu
+devic
 e = devi
@@ -474,14 +474,57 @@
 s%5B0%5D
-.value
+;%0A    value = parseFloat(device.value).toFixed(1)
 ;%0A%0A 

Fix temperature sensor callback