diff --git a/CHANGELOG.md b/CHANGELOG.md index ee2486d..4dd7495 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 1.1.4 + +- [FIX] unresponsive in case of negative temperature #46 + ## 1.1.3 - [NEW] funding link diff --git a/index.js b/index.js index 185c6f5..8fcc1ae 100644 --- a/index.js +++ b/index.js @@ -569,14 +569,21 @@ Gogogate2Platform.prototype = { }, bindCurrentTemperatureLevelCharacteristic: function (service) { - service.getCharacteristic(Characteristic.CurrentTemperature).on( - 'get', - function (callback) { - var temp = service.getCharacteristic(Characteristic.CurrentTemperature).value; - callback(undefined, temp); - this.gogogateAPI.refreshSensor(service.gateId); - }.bind(this) - ); + service + .getCharacteristic(Characteristic.CurrentTemperature) + //to handle negative temps + .setProps({ + minValue: -50, + maxValue: 50, + }) + .on( + 'get', + function (callback) { + var temp = service.getCharacteristic(Characteristic.CurrentTemperature).value; + callback(undefined, temp); + this.gogogateAPI.refreshSensor(service.gateId); + }.bind(this) + ); }, bindChargingStateCharacteristic: function (service) { diff --git a/package.json b/package.json index 590afe2..939624c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-gogogate2", - "version": "1.1.3", + "version": "1.1.4", "author": "Nicolas Dujardin", "description": "Publish your gogogate 2 to homebridge", "main": "index.js",