Open
Description
Considering that the whole US and UK use Farenheit degrees instead of Celsius, support for such system should be provided.
Example proposal:
temperature.get/set(value, "measuring system")
┆Issue is synchronized with this Asana task
Activity
abhiche commentedon Apr 4, 2016
Just a slight enhancement to @Joncy suggestion.
How about setting it unit once rather than specifying it everytime:
temperature.setUnits(TEMP_UNIT.CELCIUS)
jsdario commentedon Apr 4, 2016
This is tricky: each device / plugin may announce the measured temperature in a different format. For that, what about implementing it through a JSON common format?
If temperature is a string, it can be interpreted as CELSIUS, but in JSON:
We do like this with colors. Then we can transform between different systems as you guys mentioned above.
abhiche commentedon Apr 4, 2016
Hope I get your point.
But if you provide {fahrenheit : x} as result, and if at a later stage, to switch to celcius will need the developer to refactor the code.
Instead I would recommend to provide {temperature :x} as the result. Since the developer knows which unit he has set already.
jsdario commentedon Apr 5, 2016
The problem is that the data is shared across the plugin ecosystem, thus is not only matter of the developer only, and the rest of plugins must understand the data and the format. Having the
netbeast
npm package a suite of temperature functions to change scales is not big deal, but the scale must go beside the data.So our best options are JSON
{ farenheit: 451 }
or strings451Fº
which I do not really like... In any case this as you pointed @abhiche must be wrapped:Joncy commentedon Apr 5, 2016
I feel that doing it with JSON and with the implementation @jsdario last proposed would be the best way