indigo-jay / indigo-ecobee-plugin

Plugin for Indigo home automation software to support Ecobee thermostats and remote sensors
5 stars 9 forks source link

Fixed issue with plugin scales other than F #9

Closed NSBum closed 7 years ago

NSBum commented 7 years ago

The plugin did not properly handle setpoints in temperatures other than Fahrenheit. The plugin was enforcing a set point range between 40 and 95 (assuming degrees F) preventing Celsius users from setting set points correctly, e.g.

if newSetpoint < 40.0:
    newSetpoint = 40.0
elif newSetpoint > 95.0:
    newSetpoint = 95.0

Since the API is in °F, some interconversion is required to allow the user to create set points in their plugin-defined temperature scale preference.

N.B. - I've tested this on my hardware which is all in °C but not on an Ecobee whose units are in °F. N.B. - Also did not increment the version number

jdhorne commented 7 years ago

Thank you for this! Looks like there may be a typo in the 'R' scale formula in the _toFahrenheit method, but I'm guessing that's not something that people will really encounter. 😄

I'll commit this to my 'develop' working branch for further testing before pushing it to master.

Thanks again!