Closed ut666 closed 6 years ago
I edited the ftoc and ctof functions to include a rounding function that rounds to the nearest 0.5C
I also removed the Math.round wrapped around each ftoc and ctof and this seems to fix the issue.
// function to convert Celcius (Alexa default) to Farenheit function cToF(celsius) { return Math.round((celsius 9 / 5 + 32)2)/2; }
// function to convert Farenheit to Celcius (Alexa default) function fToC(fahrenheit) { return Math.round(((fahrenheit - 32) 5 / 9)2)/2;
//return (fahrenheit - 32) * 5 / 9; }
Thank you @yungwesl! Your edits will be included in the latest release.
There seems to be a precision/rounding error. I successfully installed this and queried the current temperature downstairs, the alexa spoken reply I got was: 24.44444444444444443 instead of 24.5.
My 2yr old found it hilarious though :) And great work btw!