metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

Support for negative values #3

Closed MichaelS75 closed 7 years ago

MichaelS75 commented 7 years ago

First of all, thank you for this great plugin. Today I discovered that only 0 or positive temperature values are supported.

To fix the issue and support negative temperatures too, replace the following code in index.js (line 74-76)

      this.temperatureService
         .getCharacteristic(Characteristic.CurrentTemperature)
         .on('get', this.getState.bind(this))

by

      this.temperatureService
         .getCharacteristic(Characteristic.CurrentTemperature)
         .on('get', this.getState.bind(this))
         .setProps({
             minValue: -50,
             maxValue: 100
         });

and you're done. Cheers, MichaelS75

metbosch commented 7 years ago

Hi, Thanks for the point! I fixed it and updated the new code on the npm (version 0.0.3).