WLANThermo-nano / WLANThermo_ESP32_Software

GNU General Public License v3.0
34 stars 19 forks source link

/data API should have a settings independent temperature value #162

Closed ktetzlaff closed 3 years ago

ktetzlaff commented 3 years ago

The current API(s) send temperature values which depend on the system unit (Celsius/Fahrenheit). In my opinion, this is not a good idea (s. also #160). For backward compatibility reasons, this probably cannot be changed. However, maybe it is possible to add an additional value which is unit independen (e.g. temp_celsius, temp_kelvin or temp_unit_indep)?

sochs commented 3 years ago

Basically correct, SI unit (Kelvin) would be more uniform. But then a conversion (to Celsius or Fahrenheit) would always have to be carried out in the external service = a lot of computing power with a lot of data. However, in 99 % of the cases, the same unit will be used in the external service as on the device. In the rare cases where this is not the case, unit information in /data and /settings can still be used to convert. Carrying the same information in different units in the API just inflates it unnecessarily. From a performance point of view, the current implementation makes the most sense for us.