So I thought: "This might be a job for dashboard". This backend take MEASURE clues of the form "10.34oF" (a number followed by some unit) and translate it to an understandable unit system.
These conversion are defined in ".dashboard/backend-data/conversion/config.xml". This file use a XML format to describe each conversion. Each node represent a conversion:
<Conversion Enabled="true" From="oF" To="oC" Factor="0.55" Add="-17,6">
here are the attributes description:
Enabled
specify if we should use this conversion
From
specify the unit to convert from
To
specify the unit to convert to
Factor
specify the multiplicator to make the conversion (double)
Add
specify a value to add after the multiplication (double)
The From string is in fact the string that will be searched for in the measure clue to identify what conversion to make, therefore there can only be one From tag by unit string (still you can have a conversion tag for "oF" and "Fahrenheit").
The To string is an indication of what string should be displayed: 32oF will then be displayed as 0oC.
Conversion are linear: y = factor*X+add


